Commit a57b737
fix: restore global logger state after enapter.log.configure tests
The original PR introduced unit tests for `enapter.log.configure` which modified the global `LOGGER` state. This global mutation leaked across tests, causing `test_standalone/test_mqtt_adapter.py` assertions like `device_channel.publish_log.assert_called()` to fail in CI.
This commit resolves the issue by wrapping the `test_log/test_init.py` tests with an `autouse=True` fixture that takes a snapshot of the original logger's `level` and `handlers.copy()`, and restores them after the test executes. It also explicitly imports `enapter.log` instead of relying on the parent package.
Co-authored-by: rnovatorov <20299819+rnovatorov@users.noreply.github.com>1 parent 08d14ef commit a57b737
1 file changed
Lines changed: 12 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
5 | 16 | | |
6 | 17 | | |
7 | 18 | | |
| |||
0 commit comments