test(jobs): skip dataset import guard in base-deps test

The fast test env installs base deps only, so require_package('datasets')
raised ImportError before the mocked lerobot.datasets import was reached.
Monkeypatch the guard to a no-op so the unit test exercises the upload logic.
This commit is contained in:
Nicolas Rabault
2026-06-25 10:01:43 +02:00
parent 4efa9da0d9
commit 6b64642bdb
+2
View File
@@ -50,6 +50,8 @@ def test_dataset_local_only_uploads_privately(tmp_path, monkeypatch):
fake_datasets_module = MagicMock()
fake_datasets_module.LeRobotDataset = mock_ds_cls
monkeypatch.setitem(sys.modules, "lerobot.datasets", fake_datasets_module)
# The `datasets` extra isn't installed in the base test env; skip the import guard.
monkeypatch.setattr("lerobot.jobs.dataset.require_package", lambda *a, **k: None)
assert ensure_dataset_available("user/ds", api=api, tags=["lerobot", "lelab"]) is None