SIGN IN SIGN UP

Migrate data tests to pytest style (#1992)

* Migrate data tests to pytest style

Convert test_LightlyDataset.py, test_VideoDataset.py and
test_data_collate.py from unittest.TestCase to plain pytest-style
classes, following the pattern in tests/loss/test_ibot_loss.py.

Data group of #1987.

* fix(tests): repair data test pytest migration failures

The unittest->pytest migration of tests/data/test_LightlyDataset.py
changed TestLightlyDataset from a unittest.TestCase subclass to a plain
class. TestLightlySubset (in test_LightlySubset.py) subclasses it and
still relied on unittest lifecycle: its setUp() set self.input_dir and
its video tests used @unittest.skipUnless. Once the parent is a plain
class, pytest no longer invokes setUp() nor honors unittest skip
markers for the subclass, so the subset tests failed with
'AttributeError: TestLightlySubset object has no attribute input_dir'
(and the no-video CI job would run the video subset test instead of
skipping it).

Migrate test_LightlySubset.py to pytest style to match its now-pytest
parent: setUp -> setup_method (invoked by pytest for plain classes) and
@unittest.skipUnless -> @pytest.mark.skipif. Coverage is unchanged.

---------

Co-authored-by: fruet <90271657+gabrielfruet@users.noreply.github.com>
J
Jayashanker Padishala committed
0dea16e076fbc41bfbc5d19cd646aad34138bb0c
Parent: a3750a0
Committed by GitHub <noreply@github.com> on 8/7/2026, 1:22:55 PM