Skip to content

Commit de3471c

Browse files
committed
FIX: ignoring has_kuadrant() check when --setup-plan option is used
When using --setup-plan to print out a "tesplan", `pytest_runtest_setup` uses `has_kuadrant()` check that might fail when oc client is not installed. Adding the condition when --setup-plan is used to skip any checks. fixes #618 Signed-off-by: Zdenek Kraus <[email protected]>
1 parent cab5452 commit de3471c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

testsuite/tests/conftest.py

+5
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ def pytest_runtest_setup(item):
3737
(https://docs.pytest.org/en/latest/example/markers.html#marking-test-functions-and-selecting-them-for-a-run)
3838
In this function we skip or fail the tests that were selected but their capabilities are not available
3939
"""
40+
# prevents ERROR OpenShiftPythonException due to oc and kuadrant not being set-up
41+
# when just printing setup plan
42+
# error is raised during has_kuadrant()
43+
if item.config.getoption("--setup-plan"):
44+
return
4045
marks = [i.name for i in item.iter_markers()]
4146
skip_or_fail = pytest.fail if item.config.getoption("--enforce") else pytest.skip
4247
standalone = item.config.getoption("--standalone")

0 commit comments

Comments
 (0)