Closed w-samuelgauthier closed 4 months ago
The cause of the failing unit tests with the HW, is due to the fact that DeviceManager
is a singleton running its own event loop. The solution is to either:
DeviceManager
and just make it non-singleton, the event loop from conftest.py
can then be usedDeviceManager
The cause of the failing unit tests with the HW, is due to the fact that
DeviceManager
is a singleton running its own event loop. The solution is to either:
- Remove the singleton annotation on
DeviceManager
and just make it non-singleton, the event loop fromconftest.py
can then be used- Pass the event loop through the constructor of the
DeviceManager
Hi Samuel, you genius, that you found out this fact. I don't particularly like to mess around with handling loops. I think this should be handled by the programming language itself. So my first attempt would be to remove the singleton annotation from the device handler. Kudos that you found the source of this behaviour!
Changelog: changed
Description
Refactor
ChargeCoupledDevice
,AbstractCommunicator
,WebsocketCommunicator
,DeviceManager
to allow better context manager usage.AbstractCommunicator
regained a function to execute a command and get the response,response_from(Command)
(it was already living inWebsocketCommunicator
under the nameexecute_command(command_str, parameters_dict)
DeviceDiscovery
class that is inside theDeviceManager
and theChargeCoupledDevices
,Monochromator
are directly instantiated inside theDeviceManager
.Related Issue
39
Type of Change
Checklist
CODE_OF_CONDUCT.md
document.CONTRIBUTING.md
guide.make codestyle
.