Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def setup_module():
- print("Setting up module")
- def teardown_module():
- print("Tearing down module")
- def setup_function(function):
- if function == test1:
- print("Setting up test1")
- elif function == test2:
- print("Setting up test2")
- else:
- print("Setting up unknow test")
- def teardown_function(function):
- if function == test1:
- print("Tearing down test1")
- elif function == test2:
- print("Tearing down test2")
- else:
- print("Tearing down unknow test")
- def test1():
- print("Executing test1")
- assert True
- def test2():
- print("Executing test2")
- assert True
- class TestClass:
- @classmethod
- def setup_class(cls):
- print("Setup TestClass!")
- @classmethod
- def teardown_class(cls):
- print("Teardown TestClass!")
- def setup_method(self, function):
- if function == test1:
- print("Setting up test1")
- elif function == test2:
- print("Setting up test2")
- else:
- print("Setting up unknow test")
- def teardown_function(self, function):
- if function == test1:
- print("Tearing down test1")
- elif function == test2:
- print("Tearing down test2")
- else:
- print("Tearing down unknow test")
- def test1(self):
- print("Executing test1 method")
- assert True
- def test2(self):
- print("Executing test2 method")
- assert True
Add Comment
Please, Sign In to add comment