(self)
| 1303 | "Emscripten's/WASI's umask is a stub." |
| 1304 | ) |
| 1305 | def test_creation_mode(self): |
| 1306 | mask = 0o022 |
| 1307 | with temp_umask(mask), ready_to_import() as (name, path): |
| 1308 | cached_path = importlib.util.cache_from_source(path) |
| 1309 | module = __import__(name) |
| 1310 | if not os.path.exists(cached_path): |
| 1311 | self.fail("__import__ did not result in creation of " |
| 1312 | "a .pyc file") |
| 1313 | stat_info = os.stat(cached_path) |
| 1314 | |
| 1315 | # Check that the umask is respected, and the executable bits |
| 1316 | # aren't set. |
| 1317 | self.assertEqual(oct(stat.S_IMODE(stat_info.st_mode)), |
| 1318 | oct(0o666 & ~mask)) |
| 1319 | |
| 1320 | @unittest.skipUnless(os.name == 'posix', |
| 1321 | "test meaningful only on posix systems") |
nothing calls this directly
no test coverage detected