Skip to content

Commit eaee775

Browse files
committed
Fix dlclive mock structure in processor tests
Update the base processor test helper to better mirror the real dlclive package layout by mocking both `dlclive` and `dlclive.processor`, and add a no-op `process` method on the dummy `Processor`. This prevents import/behavior mismatches in tests that rely on the processor interface.
1 parent 2f6cea0 commit eaee775

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

tests/custom_processors/test_base_processor.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,21 @@
1313

1414

1515
def _mock_dlclive(monkeypatch):
16-
"""Provide a dummy dlclive.Processor so the module can import in tests."""
17-
fake = types.ModuleType("dlclive")
18-
1916
class Processor:
2017
def __init__(self, *args, **kwargs):
2118
pass
2219

23-
fake.Processor = Processor
24-
monkeypatch.setitem(sys.modules, "dlclive", fake)
20+
def process(self, pose, **kwargs):
21+
return pose
22+
23+
dlclive_mod = types.ModuleType("dlclive")
24+
processor_mod = types.ModuleType("dlclive.processor")
25+
26+
dlclive_mod.Processor = Processor
27+
processor_mod.Processor = Processor
28+
29+
monkeypatch.setitem(sys.modules, "dlclive", dlclive_mod)
30+
monkeypatch.setitem(sys.modules, "dlclive.processor", processor_mod)
2531

2632

2733
@pytest.fixture

0 commit comments

Comments
 (0)