Advertisement
Guest User

Untitled

a guest
Feb 14th, 2016
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. # content of conftest.py or a tests file (e.g. in your tests or root directory)
  2.  
  3. @pytest.fixture(scope="session", autouse=True)
  4. def do_something(request):
  5. # prepare something ahead of all tests
  6. request.addfinalizer(finalizer_function)
  7.  
  8. # content of conftest.py
  9.  
  10. def pytest_sessionstart(session):
  11. """ before session.main() is called. """
  12. pass
  13.  
  14. def pytest_sessionfinish(session, exitstatus):
  15. """ whole test run finishes. """
  16. pass
  17.  
  18. setUpClass()
  19.  
  20. A class method called before tests in an individual class run
  21.  
  22. tearDownClass()
  23.  
  24. A class method called after tests in an individual class have run.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement