From a05362c79a7dc22f633f60d12e95092a29824040 Mon Sep 17 00:00:00 2001 From: Martin Hjelmare Date: Mon, 19 Aug 2024 16:40:28 +0200 Subject: [PATCH] Remove Surplus Logging from `Updater` Network Loop (#4432) --- telegram/ext/_updater.py | 1 - tests/ext/test_updater.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/telegram/ext/_updater.py b/telegram/ext/_updater.py index bdf14e0a9..30635e40a 100644 --- a/telegram/ext/_updater.py +++ b/telegram/ext/_updater.py @@ -763,7 +763,6 @@ class Updater(AsyncContextManager["Updater"]): _LOGGER.exception("Invalid token; aborting") raise except TelegramError as telegram_exc: - _LOGGER.exception("Error while %s:", description) on_err_cb(telegram_exc) # increase waiting times on subsequent errors up to 30secs diff --git a/tests/ext/test_updater.py b/tests/ext/test_updater.py index f72161008..84a86c988 100644 --- a/tests/ext/test_updater.py +++ b/tests/ext/test_updater.py @@ -571,7 +571,7 @@ class TestUpdater: else: assert len(caplog.records) > 0 assert any( - "Error while getting Updates:" in record.getMessage() + "Exception happened while polling for updates." in record.getMessage() and record.name == "telegram.ext.Updater" for record in caplog.records ) @@ -593,7 +593,7 @@ class TestUpdater: else: assert len(caplog.records) > 0 assert any( - "Error while getting Updates:" in record.getMessage() + "Exception happened while polling for updates." in record.getMessage() and record.name == "telegram.ext.Updater" for record in caplog.records )