You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/10/20 22:52:33 UTC

[GitHub] [tvm] Lunderberg opened a new pull request #9335: [MicroTVM][PyTest] Explicitly skip MicroTVM unittests.

Lunderberg opened a new pull request #9335:
URL: https://github.com/apache/tvm/pull/9335


   Refactor unit tests so they will show as skipped if `USE_MICRO=OFF`.


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] Mousius commented on a change in pull request #9335: [MicroTVM][PyTest] Explicitly skip MicroTVM unittests.

Posted by GitBox <gi...@apache.org>.
Mousius commented on a change in pull request #9335:
URL: https://github.com/apache/tvm/pull/9335#discussion_r733500187



##########
File path: tests/python/unittest/test_micro_transport.py
##########
@@ -26,8 +26,7 @@
 import tvm.testing
 
 
-@tvm.testing.requires_micro
-class TransportLoggerTests(unittest.TestCase):
+def test_transport_class():

Review comment:
       This would be nice as a fixture as above.

##########
File path: tests/python/unittest/test_micro_project_api.py
##########
@@ -26,45 +26,48 @@
 
 import tvm
 
-pytest.importorskip("tvm.micro")
-from tvm.micro import project_api
 
+@tvm.testing.fixture
+def BaseTestHandler():
+    from tvm.micro import project_api
 
-class BaseTestHandler(project_api.server.ProjectAPIHandler):
+    class BaseTestHandler(project_api.server.ProjectAPIHandler):

Review comment:
       Unsure about the name shadowing here, but this is neat.




-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] Lunderberg commented on a change in pull request #9335: [MicroTVM][PyTest] Explicitly skip MicroTVM unittests.

Posted by GitBox <gi...@apache.org>.
Lunderberg commented on a change in pull request #9335:
URL: https://github.com/apache/tvm/pull/9335#discussion_r733762985



##########
File path: tests/python/unittest/test_micro_project_api.py
##########
@@ -26,45 +26,48 @@
 
 import tvm
 
-pytest.importorskip("tvm.micro")
-from tvm.micro import project_api
 
+@tvm.testing.fixture
+def BaseTestHandler():
+    from tvm.micro import project_api
 
-class BaseTestHandler(project_api.server.ProjectAPIHandler):
+    class BaseTestHandler(project_api.server.ProjectAPIHandler):

Review comment:
       Thank you.  Most of the time I would try to move the possibly-missing imports into the test itself, but here it wasn't possible without moving the entire class definition as well.  Good point on the name shadowing, and I've updated the inner class definition to be "BaseTestHandler_Impl" instead.




-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] areusch merged pull request #9335: [MicroTVM][PyTest] Explicitly skip MicroTVM unittests.

Posted by GitBox <gi...@apache.org>.
areusch merged pull request #9335:
URL: https://github.com/apache/tvm/pull/9335


   


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] Lunderberg commented on a change in pull request #9335: [MicroTVM][PyTest] Explicitly skip MicroTVM unittests.

Posted by GitBox <gi...@apache.org>.
Lunderberg commented on a change in pull request #9335:
URL: https://github.com/apache/tvm/pull/9335#discussion_r733764585



##########
File path: tests/python/unittest/test_micro_transport.py
##########
@@ -26,8 +26,7 @@
 import tvm.testing
 
 
-@tvm.testing.requires_micro
-class TransportLoggerTests(unittest.TestCase):
+def test_transport_class():

Review comment:
       Good point, I hadn't done so initially because this file was written with `unittest` instead of `pytest`.  I've refactored this entire file to use `pytest`, and to split out the different tests of functionality into different test cases, with the class definition now included in a fixture.




-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org