(self, *mocks)
| 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. |
| 589 | class TestSystemPipedExitCode(ExitCodeChecks): |