(self)
| 1338 | "test meaningful only on posix systems") |
| 1339 | @os_helper.skip_unless_working_chmod |
| 1340 | def test_cached_readonly(self): |
| 1341 | mode = 0o400 |
| 1342 | with temp_umask(0o022), ready_to_import() as (name, path): |
| 1343 | cached_path = importlib.util.cache_from_source(path) |
| 1344 | os.chmod(path, mode) |
| 1345 | __import__(name) |
| 1346 | if not os.path.exists(cached_path): |
| 1347 | self.fail("__import__ did not result in creation of " |
| 1348 | "a .pyc file") |
| 1349 | stat_info = os.stat(cached_path) |
| 1350 | |
| 1351 | expected = mode | 0o200 # Account for fix for issue #6074 |
| 1352 | self.assertEqual(oct(stat.S_IMODE(stat_info.st_mode)), oct(expected)) |
| 1353 | |
| 1354 | def test_pyc_always_writable(self): |
| 1355 | # Initially read-only .pyc files on Windows used to cause problems |
nothing calls this directly
no test coverage detected