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

Method assertSigInt

Lib/test/test_runpy.py:837–842  ·  view source on GitHub ↗
(self, cmd, *args, **kwargs)

Source from the content-addressed store, hash-verified

835
836 @requires_subprocess()
837 def assertSigInt(self, cmd, *args, **kwargs):
838 # Use -E to ignore PYTHONSAFEPATH
839 cmd = [sys.executable, '-E', *cmd]
840 proc = subprocess.run(cmd, *args, **kwargs, text=True, stderr=subprocess.PIPE)
841 self.assertEndsWith(proc.stderr, "\nKeyboardInterrupt\n")
842 self.assertEqual(proc.returncode, self.EXPECTED_CODE)
843
844 def test_pymain_run_file(self):
845 self.assertSigInt([self.ham])

Calls 3

assertEndsWithMethod · 0.80
runMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected