#NEWLINE# def test_teardown( testdir ) : #NEWLINE# #INDENT# testpath = testdir . makepyfile ( '\n        import unittest\n        class MyTestCase(unittest.TestCase):\n            l = []\n            def test_one(self):\n                pass\n            def tearDown(self):\n                self.l.append(None)\n        class Second(unittest.TestCase):\n            def test_check(self):\n                self.assertEquals(MyTestCase.l, [None])\n    ' ) #NEWLINE# reprec = testdir . inline_run ( testpath ) #NEWLINE# ( passed , skipped , failed ) = reprec . countoutcomes ( ) #NEWLINE# assert ( failed == 0 ) , failed #NEWLINE# assert ( passed == 2 ) #NEWLINE# assert ( ( ( passed + skipped ) + failed ) == 2 )