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

Method test_get_sourcefile

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

Source from the content-addressed store, hash-verified

1831 """
1832
1833 def test_get_sourcefile(self):
1834 # Given a valid bytecode path, return the path to the corresponding
1835 # source file if it exists.
1836 with mock.patch('importlib._bootstrap_external._path_isfile') as _path_isfile:
1837 _path_isfile.return_value = True
1838 path = TESTFN + '.pyc'
1839 expect = TESTFN + '.py'
1840 self.assertEqual(_get_sourcefile(path), expect)
1841
1842 def test_get_sourcefile_no_source(self):
1843 # Given a valid bytecode path without a corresponding source path,

Callers

nothing calls this directly

Calls 2

_get_sourcefileFunction · 0.90
assertEqualMethod · 0.45

Tested by

no test coverage detected