Skip to content

Commit e0ee749

Browse files
committed
[tests] Avoid Celery logging interference in connection tests
The connection task test patched all Logger.info calls, so Celery's eager task success log could become the final mocked call and fail the assertion when the test was reused by extended apps. Patch only the connection task logger to keep the assertion focused on the application log emitted by update_config.
1 parent 977b7b6 commit e0ee749

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

openwisp_controller/connection/tests/test_tasks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def test_update_config_missing_device(self, mocked_sleep, mocked_warning):
9494
)
9595
mocked_sleep.assert_called_once()
9696

97-
@mock.patch("logging.Logger.info")
97+
@mock.patch("openwisp_controller.connection.tasks.logger.info")
9898
@mock.patch("time.sleep")
9999
def test_update_config_skipped_for_deactivated_device(
100100
self, mocked_sleep, mocked_info

0 commit comments

Comments
 (0)