Skip to content

Commit 01a5d81

Browse files
authored
Arm Backend: Use tosa_ref_model only if it is avaiable
Differential Revision: D74420616 Pull Request resolved: #10778
1 parent 6e3cb79 commit 01a5d81

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

backends/arm/test/conftest.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,20 @@ def pytest_configure(config):
4444
if getattr(config.option, "fast_fvp", False):
4545
pytest._test_options["fast_fvp"] = config.option.fast_fvp # type: ignore[attr-defined]
4646

47+
pytest._test_options["tosa_version"] = "0.80" # type: ignore[attr-defined]
4748
if config.option.arm_run_tosa_version:
4849
pytest._test_options["tosa_version"] = config.option.arm_run_tosa_version
4950

50-
pytest._test_options["tosa_ref_model"] = True # type: ignore[attr-defined]
51+
# Not all deployments of ET have the TOSA reference model available.
52+
# Make sure we don't try to use it if it's not available.
53+
try:
54+
if pytest._test_options["tosa_version"] == "0.80":
55+
import tosa_tools.v0_80.tosa_reference_model as tosa_reference_model
56+
else:
57+
import tosa_tools.tosa_ref_model as tosa_reference_model
58+
except ImportError:
59+
pytest._test_options["tosa_ref_model"] = False # type: ignore[attr-defined]
60+
tosa_reference_model = None # noqa
5161

5262
logging.basicConfig(level=logging.INFO, stream=sys.stdout)
5363

0 commit comments

Comments
 (0)