Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
f18cf5cb
Commit
f18cf5cb
authored
Feb 14, 2015
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Plain Diff
Issue #17753: Skip test_zipfile tests which require write access to test
and email.test.
parents
62217978
08e8a412
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
Lib/test/test_zipfile.py
Lib/test/test_zipfile.py
+8
-0
No files found.
Lib/test/test_zipfile.py
View file @
f18cf5cb
...
...
@@ -679,7 +679,12 @@ class PyZipFileTests(unittest.TestCase):
if
name
+
'o'
not
in
namelist
:
self
.
assertIn
(
name
+
'c'
,
namelist
)
def
requiresWriteAccess
(
self
,
path
):
if
not
os
.
access
(
path
,
os
.
W_OK
,
effective_ids
=
True
):
self
.
skipTest
(
'requires write access to the installed location'
)
def
test_write_pyfile
(
self
):
self
.
requiresWriteAccess
(
os
.
path
.
dirname
(
__file__
))
with
TemporaryFile
()
as
t
,
zipfile
.
PyZipFile
(
t
,
"w"
)
as
zipfp
:
fn
=
__file__
if
fn
.
endswith
(
'.pyc'
)
or
fn
.
endswith
(
'.pyo'
):
...
...
@@ -711,6 +716,7 @@ class PyZipFileTests(unittest.TestCase):
def
test_write_python_package
(
self
):
import
email
packagedir
=
os
.
path
.
dirname
(
email
.
__file__
)
self
.
requiresWriteAccess
(
packagedir
)
with
TemporaryFile
()
as
t
,
zipfile
.
PyZipFile
(
t
,
"w"
)
as
zipfp
:
zipfp
.
writepy
(
packagedir
)
...
...
@@ -724,6 +730,7 @@ class PyZipFileTests(unittest.TestCase):
def
test_write_filtered_python_package
(
self
):
import
test
packagedir
=
os
.
path
.
dirname
(
test
.
__file__
)
self
.
requiresWriteAccess
(
packagedir
)
with
TemporaryFile
()
as
t
,
zipfile
.
PyZipFile
(
t
,
"w"
)
as
zipfp
:
...
...
@@ -752,6 +759,7 @@ class PyZipFileTests(unittest.TestCase):
def
test_write_with_optimization
(
self
):
import
email
packagedir
=
os
.
path
.
dirname
(
email
.
__file__
)
self
.
requiresWriteAccess
(
packagedir
)
# use .pyc if running test in optimization mode,
# use .pyo if running test in debug mode
optlevel
=
1
if
__debug__
else
0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment