Skip to content

Commit 9843351

Browse files
committed
Fix tests/rimport/test_build_parser.py on non-Glade systems.
1 parent f68c9d6 commit 9843351

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

tests/rimport/test_build_parser.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
import pytest
1111

12+
import shared
13+
1214
# Import rimport module from file without .py extension
1315
rimport_path = os.path.join(
1416
os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))),
@@ -23,6 +25,18 @@
2325
loader.exec_module(rimport)
2426

2527

28+
@pytest.fixture(scope="function", autouse=True)
29+
def fixture_temp_inputdata(temp_dirs):
30+
"""
31+
Override rimport's DEFAULT_INPUTDATA_ROOT to ensure portability.
32+
33+
We can't do it in tests/conftest.py's temp_dirs fixture because of how rimport is imported here;
34+
we'd get "no module rimport" errors. However, we can use the tempdir that got set up in that
35+
fixture.
36+
"""
37+
rimport.DEFAULT_INPUTDATA_ROOT = shared.DEFAULT_INPUTDATA_ROOT
38+
39+
2640
class TestBuildParser:
2741
"""Test suite for build_parser() function."""
2842

0 commit comments

Comments
 (0)