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

Method test_no_pyrepl_source_in_exc

Lib/test/test_pyrepl/test_pyrepl.py:2068–2078  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2066
2067 @force_not_colorized
2068 def test_no_pyrepl_source_in_exc(self):
2069 # Avoid using _pyrepl/__main__.py in traceback reports
2070 # See https://github.com/python/cpython/issues/129098.
2071 pyrepl_main_file = os.path.join(STDLIB_DIR, "_pyrepl", "__main__.py")
2072 self.assertTrue(os.path.exists(pyrepl_main_file), pyrepl_main_file)
2073 with open(pyrepl_main_file) as fp:
2074 excluded_lines = fp.readlines()
2075 excluded_lines = list(filter(None, map(str.strip, excluded_lines)))
2076
2077 for filename in ['?', 'unknown-filename', '<foo>', '<...>']:
2078 self._test_no_pyrepl_source_in_exc(filename, excluded_lines)
2079
2080 def _test_no_pyrepl_source_in_exc(self, filename, excluded_lines):
2081 with EnvironmentVarGuard() as env, self.subTest(filename=filename):

Callers

nothing calls this directly

Calls 8

listClass · 0.85
assertTrueMethod · 0.80
openFunction · 0.50
filterFunction · 0.50
joinMethod · 0.45
existsMethod · 0.45
readlinesMethod · 0.45

Tested by

no test coverage detected