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

Method test_dash_m_main_traceback

Lib/test/test_cmd_line_script.py:526–534  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

524 self.assertIn(b'Traceback', err)
525
526 def test_dash_m_main_traceback(self):
527 # Ensure that an ImportError's traceback is reported
528 with self.setup_test_pkg() as pkg_dir:
529 main = "raise ImportError('Exception in __main__ module')"
530 _make_test_script(pkg_dir, '__main__', main)
531 err = self.check_dash_m_failure('test_pkg')
532 self.assertIn(b'ImportError', err)
533 self.assertIn(b'Exception in __main__ module', err)
534 self.assertIn(b'Traceback', err)
535
536 def test_pep_409_verbiage(self):
537 # Make sure PEP 409 syntax properly suppresses

Callers

nothing calls this directly

Calls 4

setup_test_pkgMethod · 0.95
check_dash_m_failureMethod · 0.95
assertInMethod · 0.80
_make_test_scriptFunction · 0.70

Tested by

no test coverage detected