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

Method test_unwritable_directory

Lib/test/test_import/__init__.py:1691–1700  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1689 @os_helper.skip_if_dac_override
1690 @unittest.skipIf(is_emscripten, "umask is a stub")
1691 def test_unwritable_directory(self):
1692 # When the umask causes the new __pycache__ directory to be
1693 # unwritable, the import still succeeds but no .pyc file is written.
1694 with temp_umask(0o222):
1695 __import__(TESTFN)
1696 self.assertTrue(os.path.exists('__pycache__'))
1697 pyc_path = importlib.util.cache_from_source(self.source)
1698 self.assertFalse(os.path.exists(pyc_path),
1699 'bytecode file {!r} for {!r} '
1700 'exists'.format(pyc_path, TESTFN))
1701
1702 @skip_if_dont_write_bytecode
1703 def test_missing_source(self):

Callers

nothing calls this directly

Calls 6

temp_umaskFunction · 0.90
__import__Function · 0.85
assertTrueMethod · 0.80
assertFalseMethod · 0.80
existsMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected