Skip to content
Snippets Groups Projects
Unverified Commit d5d9971b authored by James Briggs's avatar James Briggs
Browse files

fix: add skip

parent 1ea14cd9
No related branches found
No related tags found
No related merge requests found
...@@ -34,14 +34,20 @@ def misshaped_pil_image(): ...@@ -34,14 +34,20 @@ def misshaped_pil_image():
class TestClipEncoder: class TestClipEncoder:
def test_clip_encoder__import_errors_transformers(self, mocker): @pytest.mark.skipif(
os.environ.get("RUN_HF_TESTS") is None, reason="Set RUN_HF_TESTS=1 to run"
)
def test_clip_encoder__import_errors_transformers(self):
with patch.dict("sys.modules", {"transformers": None}): with patch.dict("sys.modules", {"transformers": None}):
with pytest.raises(ImportError) as error: with pytest.raises(ImportError) as error:
CLIPEncoder() CLIPEncoder()
assert "install transformers" in str(error.value) assert "install transformers" in str(error.value)
def test_clip_encoder__import_errors_torch(self, mocker): @pytest.mark.skipif(
os.environ.get("RUN_HF_TESTS") is None, reason="Set RUN_HF_TESTS=1 to run"
)
def test_clip_encoder__import_errors_torch(self):
with patch.dict("sys.modules", {"torch": None}): with patch.dict("sys.modules", {"torch": None}):
with pytest.raises(ImportError) as error: with pytest.raises(ImportError) as error:
CLIPEncoder() CLIPEncoder()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment