From 4f04654a94e9846929d8e0ff276f6feff01d1419 Mon Sep 17 00:00:00 2001 From: Joshua Tzucker Date: Wed, 25 Sep 2024 14:14:16 -0700 Subject: [PATCH] Fix: Custom pytest marker registration - Needed to happen on every run, not just main --- django_utils_lib/testing/pytest_plugin.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/django_utils_lib/testing/pytest_plugin.py b/django_utils_lib/testing/pytest_plugin.py index eccf6be..cb175e1 100644 --- a/django_utils_lib/testing/pytest_plugin.py +++ b/django_utils_lib/testing/pytest_plugin.py @@ -218,10 +218,8 @@ def pytest_addoption(parser: pytest.Parser): @pytest.hookimpl() def pytest_configure(config: pytest.Config): - if not is_main_pytest_runner(config): - return - # Register markers + # Note: This should be done every time (don't wrap in `is_main_pytest_runner` check) config.addinivalue_line("markers", "requirements(requirements: List[str]): Attach requirements to test")