Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # content of conftest.py or a tests file (e.g. in your tests or root directory)
- @pytest.fixture(scope="session", autouse=True)
- def do_something(request):
- # prepare something ahead of all tests
- request.addfinalizer(finalizer_function)
- # content of conftest.py
- def pytest_sessionstart(session):
- """ before session.main() is called. """
- pass
- def pytest_sessionfinish(session, exitstatus):
- """ whole test run finishes. """
- pass
- setUpClass()
- A class method called before tests in an individual class run
- tearDownClass()
- A class method called after tests in an individual class have run.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement