(self)
| 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): |
nothing calls this directly
no test coverage detected