From 7364b8ca119ac49226595c6ec700b6d08f98b405 Mon Sep 17 00:00:00 2001 From: Mehrdad Hessar Date: Mon, 15 Aug 2022 09:21:08 -0700 Subject: [PATCH] address comments --- tests/python/relay/test_build_module.py | 27 ++++++++++++++----------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/tests/python/relay/test_build_module.py b/tests/python/relay/test_build_module.py index 0796c5ec001d4..99003276cf2b6 100644 --- a/tests/python/relay/test_build_module.py +++ b/tests/python/relay/test_build_module.py @@ -24,20 +24,23 @@ from tvm.relay.backend import Runtime, Executor, graph_executor_codegen -test_target = tvm.testing.parameter( - "c -runtime=c", - "c -system-lib", - "c -executor=aot", - "c -interface-api=c", - "c -unpacked-api=1", - "c -link-params=1", +@pytest.mark.parametrize( + "test_target,unsupported_config", + [ + ["c", {"runtime": "c"}], + ["c", {"system-lib": 1}], + ["c", {"executor": "aot"}], + ["c", {"interface-api": "c"}], + ["c", {"unpacked-api": 1}], + ["c", {"link-params": 1}], + ], ) - - -def test_deprecated_target_parameters(test_target, target): - unsupported_config = test_target.split(" ")[1].replace("=", " ").split(" ")[0][1:] +def test_deprecated_target_parameters(test_target, unsupported_config): + target_config = "" + for key, item in unsupported_config.items(): + target_config += f"{key}={item} " with pytest.raises(ValueError) as e_info: - Target(test_target) + Target(f"{test_target} {target_config}") assert f"Cannot recognize '{unsupported_config}" in str(e_info.execption)