(self)
| 122 | |
| 123 | |
| 124 | def testTwoResults(self): |
| 125 | def test_function(): |
| 126 | unittest.installHandler() |
| 127 | |
| 128 | result = unittest.TestResult() |
| 129 | unittest.registerResult(result) |
| 130 | new_handler = signal.getsignal(signal.SIGINT) |
| 131 | |
| 132 | result2 = unittest.TestResult() |
| 133 | unittest.registerResult(result2) |
| 134 | self.assertEqual(signal.getsignal(signal.SIGINT), new_handler) |
| 135 | |
| 136 | result3 = unittest.TestResult() |
| 137 | |
| 138 | try: |
| 139 | os.kill(os.getpid(), signal.SIGINT) |
| 140 | except KeyboardInterrupt: |
| 141 | self.fail("KeyboardInterrupt not handled") |
| 142 | |
| 143 | self.assertTrue(result.shouldStop) |
| 144 | self.assertTrue(result2.shouldStop) |
| 145 | self.assertFalse(result3.shouldStop) |
| 146 | self.withRepeats(test_function) |
| 147 | |
| 148 | |
| 149 | def testHandlerReplacedButCalled(self): |
nothing calls this directly
no test coverage detected