From d6a8bdc5998b49bd33c04e13e19494aff8bd543f Mon Sep 17 00:00:00 2001 From: Eric Lunderberg Date: Fri, 20 Aug 2021 12:10:40 -0500 Subject: [PATCH] [UnitTests] Moved marker definition out to global variable. --- python/tvm/testing/plugin.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/python/tvm/testing/plugin.py b/python/tvm/testing/plugin.py index 498fcced0b8b9..880b46b939ed8 100644 --- a/python/tvm/testing/plugin.py +++ b/python/tvm/testing/plugin.py @@ -40,19 +40,22 @@ from tvm.testing import utils +MARKERS = { + "gpu": "mark a test as requiring a gpu", + "tensorcore": "mark a test as requiring a tensorcore", + "cuda": "mark a test as requiring cuda", + "opencl": "mark a test as requiring opencl", + "rocm": "mark a test as requiring rocm", + "vulkan": "mark a test as requiring vulkan", + "metal": "mark a test as requiring metal", + "llvm": "mark a test as requiring llvm", +} + + def pytest_configure(config): """Runs at pytest configure time, defines marks to be used later.""" - markers = { - "gpu": "mark a test as requiring a gpu", - "tensorcore": "mark a test as requiring a tensorcore", - "cuda": "mark a test as requiring cuda", - "opencl": "mark a test as requiring opencl", - "rocm": "mark a test as requiring rocm", - "vulkan": "mark a test as requiring vulkan", - "metal": "mark a test as requiring metal", - "llvm": "mark a test as requiring llvm", - } - for markername, desc in markers.items(): + + for markername, desc in MARKERS.items(): config.addinivalue_line("markers", "{}: {}".format(markername, desc)) print("enabled targets:", "; ".join(map(lambda x: x[0], utils.enabled_targets())))