areusch commented on a change in pull request #8955:
URL: https://github.com/apache/tvm/pull/8955#discussion_r703907195



##########
File path: tests/python/unittest/test_target_codegen_hexagon.py
##########
@@ -17,30 +17,21 @@
 
 import numpy as np
 import os
+import pytest
 import re
+import sys
 import tvm
 import tvm.relay
+import tvm.testing
 import tvm.contrib.hexagon as hexagon
 
 
-def check_prereq_and_setup():
-    if tvm.target.codegen.llvm_version_major() <= 7:
-        print("Skipping test: need LLVM 7 or later for codegen")
-        return False
-    if os.name != "posix":
-        print("Skipping test on non-POSIX platforms")
-        return False
-    if not tvm.runtime.enabled("hexagon"):
-        print("Hexagon runtime not enabled")
-        return False
-    # Register a phony linker, so that we can test codegen without a Hexagon 
toolchain.
-    hexagon.register_linker(lambda: "/bin/true")
-    return True
+# Register a phony linker, so that we can test codegen without a Hexagon 
toolchain.
+hexagon.register_linker(lambda: "/bin/true")

Review comment:
       pytest-xdist will spawn new sys.executable to distribute the load, so 
shouldn't need to worry about refcounting here. the fixture should be enough. i 
am going to push on the xdist PR again soon, which is why i ask :). do you mind 
making the change here? it's not too complicated--just `@pytest.fixture` around 
a local function, move the register call there, and take the function name as 
an argument to each test_




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to