Skip to content

Instantly share code, notes, and snippets.

@isdyy
Created June 26, 2014 03:36
Show Gist options
  • Save isdyy/05db9ba531a6ce4895bc to your computer and use it in GitHub Desktop.
Save isdyy/05db9ba531a6ce4895bc to your computer and use it in GitHub Desktop.
pytest method hook order
class TestOrder(object):
def test_hook(self):
pass
def setup_method(self, method):
print 'setup_method'
def setup(self):
print 'setup'
def teardown(self):
print 'teardown'
def teardown_method(self, method):
print 'teardown_method'
# >> Result:
#
# setup_method
# setup
# teardown
# teardown_method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment