MCPcopy Create free account
hub / github.com/ipython/ipython / test_control_c

Method test_control_c

IPython/core/tests/test_interactiveshell.py:580–586  ·  view source on GitHub ↗
(self, *mocks)

Source from the content-addressed store, hash-verified

578 @mock.patch('subprocess.call', side_effect=KeyboardInterrupt)
579 @mock.patch('os.system', side_effect=KeyboardInterrupt)
580 def test_control_c(self, *mocks):
581 try:
582 self.system("sleep 1 # wont happen")
583 except KeyboardInterrupt:
584 self.fail("system call should intercept "
585 "keyboard interrupt from subprocess.call")
586 self.assertEqual(ip.user_ns['_exit_code'], -signal.SIGINT)
587
588# TODO: Exit codes are currently ignored on Windows.
589class TestSystemPipedExitCode(ExitCodeChecks):

Callers

nothing calls this directly

Calls 1

systemMethod · 0.80

Tested by

no test coverage detected