mirror of
https://github.com/huggingface/lerobot.git
synced 2026-06-28 05:37:16 +00:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user