diff --git a/tests/conftest.py b/tests/conftest.py index d5fde526e..4e5dc207b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -17,6 +17,16 @@ import pytest ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, os.path.join(ROOT, "tools")) +sys.path.insert(0, os.path.join(ROOT, "tests", "semantic")) +# Before rdna2spirv is imported: support.py installs its piecewise finder first +# where the tokenizer needs it (Python 3.12 to 3.14.7), and the finder can only +# take the import if it is in sys.meta_path when the module is first asked for. +# Without this, pytest's conftest imports it through PathFinder and +# test_support_installs_the_finder_only_where_the_tokenizer_is_slow sees the +# usual loader; run as `python tests/test_piecewise_parse.py` there is no +# conftest, which is why the same test passed one way and not the other. +import support # noqa: E402, F401 + import mc_command # noqa: E402 import rdna2spirv # noqa: E402