Skip to content

Commit 32e9e63

Browse files
authored
fix: refactor registration patching with monkeypatch
This mock potentially overloaded the _run_registration method for all tests run within the same thread.
1 parent d6d0f1a commit 32e9e63

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/test_estimator.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,11 @@ def fake_set_transform(self, i, xform):
184184
class DummyXForm:
185185
matrix = np.eye(4)
186186

187-
nifreeze.estimator._run_registration = lambda *a, **k: DummyXForm()
187+
monkeypatch.setattr(
188+
nifreeze.estimator,
189+
"_run_registration",
190+
lambda *a, **k: DummyXForm(),
191+
)
188192

189193
model = DummyModel(dataset=dataset)
190194
estimator = Estimator(model, strategy=strategy)

0 commit comments

Comments
 (0)