Skip to content

Commit 20a19fe

Browse files
author
Vincent Moens
committed
[Test] Skip tokenizer tests if transformers is not in workspace
ghstack-source-id: b92facf Pull Request resolved: #2744
1 parent 10f015e commit 20a19fe

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/test_transforms.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@
191191
TIMEOUT = 100.0
192192

193193
_has_gymnasium = importlib.util.find_spec("gymnasium") is not None
194+
_has_transformers = importlib.util.find_spec("transformers") is not None
194195

195196

196197
class TransformBase:
@@ -2532,6 +2533,9 @@ def test_transform_inverse(self):
25322533
)
25332534

25342535

2536+
@pytest.mark.skipif(
2537+
not _has_transformers, reason="transformers needed to test tokenizers"
2538+
)
25352539
class TestTokenizer(TransformBase):
25362540
@pytest.mark.parametrize("datatype", ["str", "NonTensorStack"])
25372541
def test_transform_no_env(self, datatype):

0 commit comments

Comments
 (0)