MCPcopy Index your code
hub / github.com/ipython/ipython / test_control_c

Method test_control_c

tests/test_interactiveshell.py:690–698  ·  view source on GitHub ↗
(self, *mocks)

Source from the content-addressed store, hash-verified

688 @mock.patch("subprocess.call", side_effect=KeyboardInterrupt)
689 @mock.patch("os.system", side_effect=KeyboardInterrupt)
690 def test_control_c(self, *mocks):
691 try:
692 self.system("sleep 1 # won't happen")
693 except KeyboardInterrupt: # pragma: no cove
694 self.fail(
695 "system call should intercept "
696 "keyboard interrupt from subprocess.call"
697 )
698 self.assertEqual(ip.user_ns["_exit_code"], -signal.SIGINT)
699
700
701@pytest.mark.parametrize("magic_cmd", ["pip", "conda", "cd"])

Callers

nothing calls this directly

Calls 1

systemMethod · 0.80

Tested by

no test coverage detected