From 8ed658c6aaea5a0b0e971ae1dfb5d823d1cd30e6 Mon Sep 17 00:00:00 2001 From: Pepijn Date: Fri, 3 Apr 2026 17:19:27 +0200 Subject: [PATCH] fix(tests): fix 3 failing dispatch tests - test_registry_all_types: skip non-EnvConfig stubs (e.g. TestPluginConfig) - test_processors_delegation: use None instead of abstract PreTrainedConfig - test_custom_get_env_processors_override: use DataProcessorPipeline for isinstance check (PolicyProcessorPipeline is a subscripted generic) Made-with: Cursor --- tests/envs/test_dispatch.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/envs/test_dispatch.py b/tests/envs/test_dispatch.py index 23df87b6d..7074b04c8 100644 --- a/tests/envs/test_dispatch.py +++ b/tests/envs/test_dispatch.py @@ -22,6 +22,8 @@ def test_registry_all_types(): assert len(known) >= 6 for t in known: cfg = make_env_config(t) + if not isinstance(cfg, EnvConfig): + continue assert cfg.type == t @@ -54,10 +56,8 @@ def test_delegation(): def test_processors_delegation(): """make_env_pre_post_processors delegates to cfg.get_env_processors().""" - from lerobot.configs.policies import PreTrainedConfig - cfg = make_env_config("aloha") - pre, post = make_env_pre_post_processors(cfg, PreTrainedConfig()) + pre, post = make_env_pre_post_processors(cfg, policy_cfg=None) assert len(pre.steps) == 0 @@ -124,7 +124,7 @@ def test_custom_create_envs_override(): def test_custom_get_env_processors_override(): """A custom EnvConfig subclass can override get_env_processors().""" - from lerobot.processor.pipeline import PolicyProcessorPipeline + from lerobot.processor.pipeline import DataProcessorPipeline @EnvConfig.register_subclass("_dispatch_proc_test") @dataclass @@ -137,7 +137,7 @@ def test_custom_get_env_processors_override(): return {} def get_env_processors(self): - return PolicyProcessorPipeline(steps=[]), PolicyProcessorPipeline(steps=[]) + return DataProcessorPipeline(steps=[]), DataProcessorPipeline(steps=[]) pre, post = _Env().get_env_processors() - assert isinstance(pre, PolicyProcessorPipeline) + assert isinstance(pre, DataProcessorPipeline)