-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unify DAG creation/database cleaning fixtures for testing #2622
Comments
@AetherUnbound Can I be assigned to this issue? |
@AetherUnbound @sarayourfriend Here is a code I tried to implement in
The goal was to create pytest.fixture on each individual test to override |
As far as getting I also don't know for sure if it's possible to create local overrides for fixtures the way you're proposing. I think the right approach for your idea (which sounds good to me), is to use the The idea would be to define
Also, if |
I tried using the |
Description
We have a few places in our catalog tests with very similar logic for creating the DAG necessary for running some tests. Examples:
openverse/catalog/tests/dags/common/sensors/test_single_run_external_dags_sensor.py
Lines 23 to 34 in 9056029
openverse/catalog/tests/dags/data_refresh/test_dag_factory.py
Lines 22 to 25 in 9056029
openverse/catalog/tests/dags/common/test_ingestion_server.py
Lines 21 to 31 in 9056029
openverse/catalog/tests/dags/common/sensors/test_utils.py
Lines 18 to 21 in 9056029
openverse/catalog/tests/dags/providers/test_provider_dag_factory.py
Lines 27 to 37 in 9056029
Although there are some slight differences, it would be ideal if we could find a way to combine these into a single fixture that's used within all the affected tests, rather than redefining the fixture for every test.
Additional context
Came up in discussing #2209 (comment)
The text was updated successfully, but these errors were encountered: