forked from aiogram/aiogram
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hotfix(updates): CHOSEN_INLINE_RESULT is a correct API-term (aiogram#415
) * hotfix(updates): CHOSEN_INLINE_RESULT is a correct API-term * feat(utils): deprecated descriptor deprecate CHOSEN_INLINE_QUERY and always return CHOSEN_INLINE_RESULT instead of incorrect value * fix(tests): remove example from test * fix(utils): use stacklevel=3 level on which descriptor is being called
- Loading branch information
Showing
3 changed files
with
56 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import pytest | ||
|
||
from aiogram.utils.deprecated import DeprecatedReadOnlyClassVar | ||
|
||
|
||
def test_DeprecatedReadOnlyClassVarCD(): | ||
assert DeprecatedReadOnlyClassVar.__slots__ == ("_new_value_getter", "_warning_message") | ||
|
||
new_value_of_deprecated_cls_cd = "mpa" | ||
pseudo_owner_cls = type("OpekaCla$$", (), {}) | ||
deprecated_cd = DeprecatedReadOnlyClassVar("mopekaa", lambda owner: new_value_of_deprecated_cls_cd) | ||
|
||
with pytest.warns(DeprecationWarning): | ||
assert deprecated_cd.__get__(None, pseudo_owner_cls) == new_value_of_deprecated_cls_cd |