tvm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [tvm] areusch commented on a change in pull request #8451: [UnitTests] Require cached fixtures to be copy-able, with opt-in.
Date Mon, 09 Aug 2021 19:26:12 GMT

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



##########
File path: tests/python/unittest/test_tvm_testing_features.py
##########
@@ -210,5 +210,44 @@ def test_pytest_mark_covariant(self, request, target, other_param):
         self.check_marks(request, target)
 
 
+@pytest.mark.skipif(
+    bool(int(os.environ.get("TVM_TEST_DISABLE_CACHE", "0"))),
+    reason="Cannot test cache behavior while caching is disabled",
+)
+class TestCacheableTypes:
+    class EmptyClass:
+        pass
+
+    @tvm.testing.fixture(cache_return_value=True)
+    def uncacheable_fixture(self):
+        return self.EmptyClass()
+
+    @pytest.mark.xfail(reason="Requests cached fixture of uncacheable type", strict=True)

Review comment:
       is there any way to assert on the specific error generated here?

##########
File path: tests/python/unittest/test_tvm_testing_features.py
##########
@@ -210,5 +210,44 @@ def test_pytest_mark_covariant(self, request, target, other_param):
         self.check_marks(request, target)
 
 
+@pytest.mark.skipif(
+    bool(int(os.environ.get("TVM_TEST_DISABLE_CACHE", "0"))),
+    reason="Cannot test cache behavior while caching is disabled",
+)
+class TestCacheableTypes:

Review comment:
       is there any way to assert you're getting a copy in each test case?




-- 
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



Mime
View raw message