Commit 102567b
committed
Improve finalization of battery status tests
Use the `MockMicrogrid` as a context manager and a custom async context
manager for the `BatteryStatusTracker` so all used components get
automatically finalized.
Also uses `time_machine` as a `pytest` fixture when possible to simplify
the tests and avoid having too indent too deep, as the previous approach
used a context manager too, but not an async one, so it can be combined
in the same `with` statement.
This commit can be reviewed much more easily hiding differences in
spaces (with `diff -w`, or appending `?w=1` to the GitHub URL).
Signed-off-by: Leandro Lucarella <[email protected]>1 parent 2077a44 commit 102567b
1 file changed
+349
-311
lines changed
0 commit comments