- Notifications
You must be signed in to change notification settings - Fork5.9k
Improve Warning Categories & Stacklevels#3674
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
10 commits Select commitHold shift + click to select a range
422c3b5 Update a few warning categories
Bibo-Joshie43b797 Get started on updating tests
Bibo-Joshif9888b6 review
Bibo-Joshi5e5f870 Fix existing tests & try to make warnings in Bot & ExtBot uniform
Bibo-Joshi08db55e Add/extend deprecation tests
Bibo-Joshic85dd4e fix tests
Bibo-Joshi22a1883 Review:
Bibo-Joshi92c4d08 Fix a typo
Bibo-Joshif63399e DS
Bibo-Joshi2d6cb41 More DS
Bibo-JoshiFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
50 changes: 38 additions & 12 deletionstelegram/_bot.py
This file contains hidden or 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
2 changes: 1 addition & 1 deletiontelegram/_files/_basethumbedmedium.py
This file contains hidden or 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
41 changes: 25 additions & 16 deletionstelegram/_utils/warnings_transition.py
This file contains hidden or 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
3 changes: 3 additions & 0 deletionstelegram/ext/_conversationhandler.py
This file contains hidden or 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
48 changes: 21 additions & 27 deletionstelegram/ext/_extbot.py
This file contains hidden or 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
5 changes: 4 additions & 1 deletiontelegram/ext/_picklepersistence.py
This file contains hidden or 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
18 changes: 17 additions & 1 deletiontests/_files/test_animation.py
This file contains hidden or 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 |
|---|---|---|
| @@ -31,7 +31,10 @@ | ||
| check_shortcut_call, | ||
| check_shortcut_signature, | ||
| ) | ||
| from tests.auxil.deprecations import ( | ||
| check_thumb_deprecation_warning_for_method_args, | ||
| check_thumb_deprecation_warnings_for_args_and_attrs, | ||
| ) | ||
| from tests.auxil.files import data_file | ||
| from tests.auxil.slots import mro_slots | ||
| @@ -191,6 +194,19 @@ async def make_assertion(url, request_data: RequestData, *args, **kwargs): | ||
| monkeypatch.setattr(bot.request, "post", make_assertion) | ||
| assert await bot.send_animation(animation=animation, chat_id=chat_id) | ||
| @pytest.mark.parametrize("bot_class", ["Bot", "ExtBot"]) | ||
| async def test_send_animation_thumb_deprecation_warning( | ||
| self, recwarn, monkeypatch, bot_class, bot, raw_bot, chat_id, animation | ||
| ): | ||
| async def make_assertion(url, request_data: RequestData, *args, **kwargs): | ||
| return True | ||
| bot = raw_bot if bot_class == "Bot" else bot | ||
harshil21 marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| monkeypatch.setattr(bot.request, "post", make_assertion) | ||
| await bot.send_animation(chat_id, animation, thumb="thumb") | ||
| check_thumb_deprecation_warning_for_method_args(recwarn, __file__) | ||
| async def test_send_animation_with_local_files_throws_error_with_different_thumb_and_thumbnail( | ||
| self, bot, chat_id | ||
| ): | ||
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.