test(controller): fix leaking controller instance in test.

This commit is contained in:
2026-02-12 13:34:45 +01:00
committed by Christian Appel
parent 1e9711aa17
commit b13520fe32

View File

@@ -31,16 +31,20 @@ class DummySocketSignal(SocketSignal):
@pytest.fixture
def controller():
dm = DMMock()
controller = Controller(
name="controller",
socket_cls=SocketMock,
socket_host="localhost",
socket_port=8080,
device_manager=dm,
)
controller.on()
return controller
try:
dm = DMMock()
Controller._reset_controller()
controller = Controller(
name="controller",
socket_cls=SocketMock,
socket_host="localhost",
socket_port=8080,
device_manager=dm,
)
controller.on()
return controller
finally:
Controller._reset_controller()
@pytest.fixture