Last active
June 27, 2016 16:52
-
-
Save OddBloke/d9a3e87bd397878a77f21bb080e05275 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyTestCase(unittest.TestCase): | |
def setUp(self): | |
self.foo_patcher = patch('__main__.Class', spec=True) | |
self.foo_patcher.start() | |
def tearDown(self): | |
self.foo_patcher.stop() | |
class TestThingie(MyTestCase): | |
def test_thingie(self): | |
thingie() | |
self.assertEqual(1, self.foo_patcher.call_count) | |
class TestAnotherThing(MyTestCase): | |
def setUp(self): | |
super(TestAnotherThing, self).setUp() # <-- this is important | |
... | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment