-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Arises from: ral-facilities/ldap-jwt-auth#283
Unless a scope is specified for a pytest fixture, it means that it is created and destroyed in each test. The above PR sets the scope of the fixture_test_client fixture to package so that FastAPI's TestClient object can be created before any e2e tests are run and destroyed after all the tests run. We have the same fixture in this project that will need updating but it's also worth reviewing other fixtures while at it.
inventory-management-system-api/test/e2e/conftest.py
Lines 17 to 24 in eb05b07
| @pytest.fixture(name="test_client") | |
| def fixture_test_client() -> TestClient: | |
| """ | |
| Fixture for creating a test client for the application. | |
| :return: The test client. | |
| """ | |
| return TestClient(app, headers={"Authorization": f"Bearer {VALID_ACCESS_TOKEN}"}) |
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Backlog