Skip to content

Commit 081361e

Browse files
oharboeclaude
andcommitted
flow: guard test files against missing pytest in CI
CI runs `python "$file"` on every .py in flow/test/. conftest.py and test_platform_config.py import pytest which isn't installed in the testUtilScripts CI environment. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
1 parent ff3661c commit 081361e

2 files changed

Lines changed: 16 additions & 7 deletions

File tree

flow/test/conftest.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
import pytest
1+
try:
2+
import pytest
3+
except ImportError:
4+
pass
5+
else:
26

3-
4-
def pytest_configure(config):
5-
config.addinivalue_line(
6-
"markers", "integration: mark test as integration test (requires Make)"
7-
)
7+
def pytest_configure(config):
8+
config.addinivalue_line(
9+
"markers", "integration: mark test as integration test (requires Make)"
10+
)

flow/test/test_platform_config.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1195,4 +1195,10 @@ def test_make_metadata(self, platform, design):
11951195

11961196

11971197
if __name__ == "__main__":
1198-
pytest.main([__file__, "-v", "-m", "not integration"])
1198+
try:
1199+
import pytest
1200+
1201+
pytest.main([__file__, "-v", "-m", "not integration"])
1202+
except ImportError:
1203+
print("pytest not installed, skipping tests")
1204+
pass

0 commit comments

Comments
 (0)