MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_missing_source

Method test_missing_source

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

Source from the content-addressed store, hash-verified

1654
1655 @skip_if_dont_write_bytecode
1656 def test_missing_source(self):
1657 # With PEP 3147 cache layout, removing the source but leaving the pyc
1658 # file does not satisfy the import.
1659 __import__(TESTFN)
1660 pyc_file = importlib.util.cache_from_source(self.source)
1661 self.assertTrue(os.path.exists(pyc_file))
1662 os.remove(self.source)
1663 forget(TESTFN)
1664 importlib.invalidate_caches()
1665 self.assertRaises(ImportError, __import__, TESTFN)
1666
1667 @skip_if_dont_write_bytecode
1668 def test_missing_source_legacy(self):

Callers

nothing calls this directly

Calls 7

forgetFunction · 0.90
assertTrueMethod · 0.80
__import__Function · 0.50
existsMethod · 0.45
removeMethod · 0.45
invalidate_cachesMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected