Commit 90f5f515 authored by Serhiy Storchaka's avatar Serhiy Storchaka

Issue #25101: Try to create a file to test write access in test_zipfile.

parent ab54ca7c
......@@ -778,6 +778,13 @@ class PyZipFileTests(unittest.TestCase):
def requiresWriteAccess(self, path):
if not os.access(path, os.W_OK):
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__))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment