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

Method test_sys_xoptions

Lib/test/test_faulthandler.py:454–464  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

452
453 @support.requires_subprocess()
454 def test_sys_xoptions(self):
455 # Test python -X faulthandler
456 code = "import faulthandler; print(faulthandler.is_enabled())"
457 args = filter(None, (sys.executable,
458 "-E" if sys.flags.ignore_environment else "",
459 "-X", "faulthandler", "-c", code))
460 env = os.environ.copy()
461 env.pop("PYTHONFAULTHANDLER", None)
462 # don't use assert_python_ok() because it always enables faulthandler
463 output = subprocess.check_output(args, env=env)
464 self.assertEqual(output.rstrip(), b"True")
465
466 @support.requires_subprocess()
467 def test_env_var(self):

Callers

nothing calls this directly

Calls 6

filterFunction · 0.50
copyMethod · 0.45
popMethod · 0.45
check_outputMethod · 0.45
assertEqualMethod · 0.45
rstripMethod · 0.45

Tested by

no test coverage detected