def test_preAndPostApplication(self):
        """
        Test thet preApplication and postApplication methods are
        called by ApplicationRunner.run() when appropriate.
        """
        s = TestApplicationRunner(self.config)
        s.run()
        self.assertFalse(s.hadApplicationPreApplication)
        self.assertTrue(s.hadApplicationPostApplication)
        self.assertTrue(s.hadApplicationLogObserver)
        self.assertEqual(s.order, ["pre", "log", "post"])

        Test thet preApplication and postApplication methods are
        called by ApplicationRunner.run() when appropriate.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_twistd.py