def test_addCleanupCalledIfSetUpFails(self):
        """
        Callables added with C{addCleanup} are run even if setUp fails.
        """
        self.test.setUp = self.test.brokenSetUp
        self.test.addCleanup(self.test.append, 'foo')
        self.test.run(self.result)
        self.assertEqual(['setUp', 'foo'], self.test.log)

        Callables added with C{addCleanup} are run even if setUp fails.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/trial/test/test_tests.py