def test_callWhenRunningOrder(self):
        """
        Functions are run in the order that they were passed to
        L{reactor.callWhenRunning}.
        """
        reactor = self.buildReactor()
        events = []
        reactor.callWhenRunning(events.append, "first")
        reactor.callWhenRunning(events.append, "second")
        reactor.callWhenRunning(reactor.stop)
        self.runReactor(reactor)
        self.assertEqual(events, ["first", "second"])

        Functions are run in the order that they were passed to
        L{reactor.callWhenRunning}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/test/test_core.py