| | 301 | def test_processExitedRaises(self): |
| | 302 | """ |
| | 303 | Test that a protocol raising an exception inside processExited |
| | 304 | doesn't cause the reactor to explode. |
| | 305 | """ |
| | 306 | class TestException(Exception): |
| | 307 | pass |
| | 308 | |
| | 309 | class Protocol(ProcessProtocol): |
| | 310 | def processExited(self, reason): |
| | 311 | raise TestException("processedExited raised") |
| | 312 | |
| | 313 | reactor = self.buildReactor() |
| | 314 | protocol = Protocol() |
| | 315 | transport = reactor.spawnProcess( |
| | 316 | protocol, sys.executable, [sys.executable, "-c", ""], |
| | 317 | usePTY=self.usePTY) |
| | 318 | |
| | 319 | transport.processEnded(0) |
| | 320 | # TODO: would be good to regain control of the reactor here and |
| | 321 | # then fail via an assert |
| | 322 | |
| | 323 | |