mirror of
https://github.com/python/cpython.git
synced 2025-07-21 18:25:22 +00:00
Issue #25101: Try to create a file to test write access in test_zipfile.
This commit is contained in:
commit
f2d7ea1af1
1 changed files with 7 additions and 0 deletions
|
@ -684,6 +684,13 @@ class PyZipFileTests(unittest.TestCase):
|
||||||
if not os.access(path, os.W_OK,
|
if not os.access(path, os.W_OK,
|
||||||
effective_ids=os.access in os.supports_effective_ids):
|
effective_ids=os.access in os.supports_effective_ids):
|
||||||
self.skipTest('requires write access to the installed location')
|
self.skipTest('requires write access to the installed location')
|
||||||
|
filename = os.path.join(path, 'test_zipfile.try')
|
||||||
|
try:
|
||||||
|
fd = os.open(filename, os.O_WRONLY | os.O_CREAT)
|
||||||
|
os.close(fd)
|
||||||
|
except Exception:
|
||||||
|
self.skipTest('requires write access to the installed location')
|
||||||
|
unlink(filename)
|
||||||
|
|
||||||
def test_write_pyfile(self):
|
def test_write_pyfile(self):
|
||||||
self.requiresWriteAccess(os.path.dirname(__file__))
|
self.requiresWriteAccess(os.path.dirname(__file__))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue