Skip to content

Commit 996bc9d

Browse files
authored
Only load OpenVINO excludes file when backend is "openvino". (keras-team#20923)
It is not necessary to decorate excluded openvino tests with other backends.
1 parent da07901 commit 996bc9d

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

conftest.py

+11-9
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,17 @@ def pytest_configure(config):
2525

2626

2727
def pytest_collection_modifyitems(config, items):
28-
with open(
29-
"keras/src/backend/openvino/excluded_concrete_tests.txt", "r"
30-
) as file:
31-
openvino_skipped_tests = file.readlines()
32-
# it is necessary to check if stripped line is not empty
33-
# and exclude such lines
34-
openvino_skipped_tests = [
35-
line.strip() for line in openvino_skipped_tests if line.strip()
36-
]
28+
openvino_skipped_tests = []
29+
if backend() == "openvino":
30+
with open(
31+
"keras/src/backend/openvino/excluded_concrete_tests.txt", "r"
32+
) as file:
33+
openvino_skipped_tests = file.readlines()
34+
# it is necessary to check if stripped line is not empty
35+
# and exclude such lines
36+
openvino_skipped_tests = [
37+
line.strip() for line in openvino_skipped_tests if line.strip()
38+
]
3739

3840
requires_trainable_backend = pytest.mark.skipif(
3941
backend() == "numpy" or backend() == "openvino",

0 commit comments

Comments
 (0)