Created
February 25, 2016 20:11
-
-
Save ekozlowski/a34d18164d55388591a0 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 Test_ThisStuff(object): | |
def setup(self): | |
print('Setting up') | |
self.name = 'Ed' | |
self.age = 38 | |
def teardown(self): | |
print('tearing down') | |
self.name = None | |
self.age = None | |
def test_name(self): | |
assert self.name == "Ed" | |
def test_age(self): | |
assert self.age == 38 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is how I use setup and teardown. Running py.test with -s will show you stdout output, and you can see setup and teardown being executed for each test.