From 3c87e450fb41bc482699a9642f47c6987ab4eaa1 Mon Sep 17 00:00:00 2001 From: Harshil <37377066+harshil21@users.noreply.github.com> Date: Thu, 22 Jun 2023 13:51:53 +0530 Subject: [PATCH] Fix Wrong Warning Text in `KeyboardButton.__eq__` (#3768) --- telegram/_keyboardbutton.py | 4 ++-- tests/test_keyboardbutton.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/telegram/_keyboardbutton.py b/telegram/_keyboardbutton.py index 9f08d7f3c..651279c08 100644 --- a/telegram/_keyboardbutton.py +++ b/telegram/_keyboardbutton.py @@ -163,8 +163,8 @@ class KeyboardButton(TelegramObject): def __eq__(self, other: object) -> bool: warn( - "In v21, granular media settings will be considered as well when comparing" - " ChatPermissions instances.", + "In v21, `request_user` and `request_chat` will be considered as well when comparing" + " KeyboardButton instances.", PTBDeprecationWarning, stacklevel=2, ) diff --git a/tests/test_keyboardbutton.py b/tests/test_keyboardbutton.py index f58af574c..84319acf0 100644 --- a/tests/test_keyboardbutton.py +++ b/tests/test_keyboardbutton.py @@ -139,8 +139,8 @@ class TestKeyboardButtonWithoutRequest(TestKeyboardButtonBase): assert keyboard_button == keyboard_button assert str(recwarn[0].message) == ( - "In v21, granular media settings will be considered as well when comparing" - " ChatPermissions instances." + "In v21, `request_user` and `request_chat` will be considered as well when comparing" + " KeyboardButton instances." ) assert recwarn[0].category is PTBDeprecationWarning assert recwarn[0].filename == __file__, "wrong stacklevel"