File indexing completed on 2026-04-27 07:41:42
0001 """
0002 This conftest.py ensures that if pytest is run directly on a test file (not via the test script or project root),
0003 it will gently fail with a clear message instructing the user to use the correct test runner for robustness.
0004 """
0005 import os
0006 import pytest
0007
0008 def pytest_configure(config):
0009
0010
0011 if not os.environ.get("DJANGO_SETTINGS_MODULE"):
0012 pytest.exit(
0013 "\n[SWF-MONITOR TEST SUITE]\n\n"
0014 "You are running pytest in a way that does not configure Django settings.\n"
0015 "For robust and reliable results, always run tests using:\n"
0016 " ./run_tests.sh (from this repo root)\n"
0017 "or\n"
0018 " ./run_all_tests.sh (from the umbrella/testbed repo root)\n\n"
0019 "Direct invocation of pytest on a test file or from the wrong directory is not supported.\n",
0020 returncode=4
0021 )