Fix Wrong Warning Text in KeyboardButton.__eq__ (#3768)

This commit is contained in:
Harshil 2023-06-22 13:51:53 +05:30 committed by GitHub
parent 8e91a6adba
commit 3c87e450fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -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,
)

View file

@ -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"