Skip to content

Commit

Permalink
[Test] Skip tokenizer tests if transformers is not in workspace
Browse files Browse the repository at this point in the history
ghstack-source-id: c0570300ba765b59199d58b8fd28581e828b5875
Pull Request resolved: #2744
  • Loading branch information
vmoens committed Feb 3, 2025
1 parent 1492a1d commit a8fc296
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/test_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@
TIMEOUT = 100.0

_has_gymnasium = importlib.util.find_spec("gymnasium") is not None
_has_transformers = importlib.util.find_spec("transformers") is not None


class TransformBase:
Expand Down Expand Up @@ -2532,6 +2533,9 @@ def test_transform_inverse(self):
)


@pytest.mark.skipif(
not _has_transformers, reason="transformers needed to test tokenizers"
)
class TestTokenizer(TransformBase):
@pytest.mark.parametrize("datatype", ["str", "NonTensorStack"])
def test_transform_no_env(self, datatype):
Expand Down

0 comments on commit a8fc296

Please sign in to comment.