def test_addCleanupCalledInReverseOrder(self):
        """
        Callables added with C{addCleanup} should be called before C{tearDown}
        in reverse order of addition.
        """
        self.test.addCleanup(self.test.append, "foo")
        self.test.addCleanup(self.test.append, 'bar')
        self.test.run(self.result)
        self.assertEqual(['setUp', 'runTest', 'bar', 'foo', 'tearDown'],
                         self.test.log)

        Callables added with C{addCleanup} should be called before C{tearDown}
        in reverse order of addition.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/trial/test/test_tests.py