diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-09-19 10:59:48 +0300 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-09-19 10:59:48 +0300 |
commit | f2d7ea1af124aa80df7ec3071a62442294f9196c (patch) | |
tree | 489fba41fe00eef417dbd39a4d175979b4886888 | |
parent | aa00324f731c877bcda7cb6cb7243a437a33ef34 (diff) | |
parent | d86a6ef41c7ef746ca871c2c1a74999327d73a7d (diff) | |
download | cpython-git-f2d7ea1af124aa80df7ec3071a62442294f9196c.tar.gz |
Issue #25101: Try to create a file to test write access in test_zipfile.
-rw-r--r-- | Lib/test/test_zipfile.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_zipfile.py b/Lib/test/test_zipfile.py index 67e85704aa..2c10821a0c 100644 --- a/Lib/test/test_zipfile.py +++ b/Lib/test/test_zipfile.py @@ -684,6 +684,13 @@ class PyZipFileTests(unittest.TestCase): if not os.access(path, os.W_OK, effective_ids=os.access in os.supports_effective_ids): 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): self.requiresWriteAccess(os.path.dirname(__file__)) |