MCPcopy Index your code
hub / github.com/python/cpython / requiresWriteAccess

Method requiresWriteAccess

Lib/test/test_zipfile/test_core.py:1442–1453  ·  view source on GitHub ↗
(self, path)

Source from the content-addressed store, hash-verified

1440 self.assertIn(name + 'c', namelist)
1441
1442 def requiresWriteAccess(self, path):
1443 # effective_ids unavailable on windows
1444 if not os.access(path, os.W_OK,
1445 effective_ids=os.access in os.supports_effective_ids):
1446 self.skipTest('requires write access to the installed location')
1447 filename = os.path.join(path, 'test_zipfile.try')
1448 try:
1449 fd = os.open(filename, os.O_WRONLY | os.O_CREAT)
1450 os.close(fd)
1451 except Exception:
1452 self.skipTest('requires write access to the installed location')
1453 unlink(filename)
1454
1455 def test_write_pyfile(self):
1456 self.requiresWriteAccess(os.path.dirname(__file__))

Calls 6

unlinkFunction · 0.90
accessMethod · 0.80
skipTestMethod · 0.80
joinMethod · 0.45
openMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected