def test_runAfterCrash(self):
        """
        C{reactor.run()} restarts the reactor after it has been stopped by
        C{reactor.crash()}.
        """
        events = []
        def crash():
            events.append('crash')
            reactor.crash()
        reactor = self.buildReactor()
        reactor.callWhenRunning(crash)
        self.runReactor(reactor)
        def stop():
            events.append(('stop', reactor.running))
            reactor.stop()
        reactor.callWhenRunning(stop)
        self.runReactor(reactor)
        self.assertEqual(events, ['crash', ('stop', True)])

        C{reactor.run()} restarts the reactor after it has been stopped by
        C{reactor.crash()}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/test/test_core.py