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/08/09 21:34:13 UTC
[GitHub] [tvm] Lunderberg commented on a change in pull request #8451: [UnitTests] Require cached fixtures to be copy-able, with opt-in.
Lunderberg commented on a change in pull request #8451:
URL: https://github.com/apache/tvm/pull/8451#discussion_r685536836
##########
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:
Normally, yes, with `pytest.raises`. Unfortunately, I don't think that's possible here, because the exception is raised during the fixture function definition.
--
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