File indexing completed on 2026-04-25 08:29:12
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 if os.path.basename(os.getcwd()) != "swf-testbed":
0011 pytest.exit(
0012 "\n[SWF-TESTBED TEST SUITE]\n\n"
0013 "You are running pytest in a way that does not use the robust test runner.\n"
0014 "For robust and reliable results, always run tests using:\n"
0015 " ./run_tests.sh (from this repo root)\n"
0016 "or\n"
0017 " ./run_all_tests.sh (from the umbrella/testbed repo root)\n\n"
0018 "Direct invocation of pytest on a test file or from the wrong directory is not supported.\n",
0019 returncode=4
0020 )