Refactor: fixtures with static values to constants #16913
Labels
developer experience
Anything that improves the experience for Warehouse devs
testing
Test infrastructure and individual tests
We have a bunch of things in
conftest.py
that are declared as fixtures, but behave as constants.A few examples:
warehouse/tests/conftest.py
Lines 118 to 137 in 694286e
warehouse/tests/conftest.py
Lines 453 to 535 in 694286e
As far as I can gather, these are used to provide some well-known value to other test cases, and since it's using the pytest fixtures decorator, that allows a test function to use them as part of their function signature, and not import them (magic! 🪄🐰🎩).
Considering this, I'm contemplating a
tests/common/constants.py
(provide your naming choice!) and relocating these functions there, asCONSTANT
-type values, and importing them in the test modules that use them.This change will:
conftest.py
The text was updated successfully, but these errors were encountered: