MCPcopy Index your code
hub / github.com/RustPython/RustPython / assertSigInt

Method assertSigInt

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

Source from the content-addressed store, hash-verified

793
794 @requires_subprocess()
795 def assertSigInt(self, cmd, *args, **kwargs):
796 # Use -E to ignore PYTHONSAFEPATH
797 cmd = [sys.executable, '-E', *cmd]
798 proc = subprocess.run(cmd, *args, **kwargs, text=True, stderr=subprocess.PIPE)
799 self.assertEndsWith(proc.stderr, "\nKeyboardInterrupt\n")
800 self.assertEqual(proc.returncode, self.EXPECTED_CODE)
801
802 def test_pymain_run_file(self):
803 self.assertSigInt([self.ham])

Calls 3

runMethod · 0.45
assertEndsWithMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected