-
-
Notifications
You must be signed in to change notification settings - Fork 2
Trio102: await inside finally needs shielding and timeout #5
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
211190a
Added first draft of TRIO102 - awaiting inside finally needs shieldin…
jakkdl 488d0c3
Actually adding all the files
jakkdl 7ba6a3a
merged in trio101
jakkdl a5d08df
Merge branch 'trio101' into trio102
jakkdl 5cefe36
big rewrite of trio102, that also changed is_trio_call to return a Tr…
jakkdl e900771
bumped release#, added to changelog, and readme
jakkdl ee2b406
merge main
jakkdl 583a6b6
fix python3.8 error
jakkdl 3daf578
added & fixed comments
jakkdl a6660ec
moved 102 to it's own visitor (some code duplication, but will fix th…
jakkdl 2753fd9
ew, I forgot to move down the function
jakkdl a582b01
added helper function for decorator, minor touchup, and more decorato…
jakkdl 70da625
Tweak message, variable name
Zac-HD File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 |
---|---|---|
@@ -1,8 +1,11 @@ | ||
# Changelog | ||
*[CalVer, YY.month.patch](https://calver.org/)* | ||
|
||
## 22.7.3 | ||
- Added TRIO102 check for unsafe checkpoints inside `finally:` blocks | ||
|
||
## 22.7.2 | ||
- Avoid `TRIO100` false-alarms on cancel scopes containing `async for` or `async with`. | ||
|
||
## 22.7.1 | ||
- Initial release | ||
- Initial release with TRIO100 and TRIO101 |
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
10000
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
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 |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
from hypothesis import HealthCheck, given, settings | ||
from hypothesmith import from_grammar, from_node | ||
|
||
from flake8_trio import TRIO100, TRIO101, Error, Plugin, Visitor, make_error | ||
from flake8_trio import TRIO100, TRIO101, TRIO102, Error, Plugin, Visitor, make_error | ||
|
||
|
||
class Flake8TrioTestCase(unittest.TestCase): | ||
|
@@ -48,6 +48,33 @@ def test_trio101(self): | |
make_error(TRIO101, 15, 8), | ||
make_error(TRIO101, 27, 8), | ||
make_error(TRIO101, 38, 8), | ||
make_error(TRIO101, 59, 8), | ||
) | ||
|
||
def test_trio102(self): | ||
self.assert_expected_errors( | ||
"trio102.py", | ||
make_error(TRIO102, 24, 8), | ||
make_error(TRIO102, 30, 12), | ||
make_error(TRIO102, 36, 12), | ||
make_error(TRIO102, 62, 12), | ||
make_error(TRIO102, 70, 12), | ||
make_error(TRIO102, 74, 12), | ||
make_error(TRIO102, 76, 12), | ||
make_error(TRIO102, 80, 12), | ||
make_error(TRIO102, 82, 12), | ||
make_error(TRIO102, 84, 12), | ||
make_error(TRIO102, 88, 12), | ||
make_error(TRIO102, 92, 8), | ||
make_error(TRIO102, 94, 8), | ||
make_error(TRIO102, 101, 12), | ||
) | ||
|
||
@unittest.skipIf(sys.version_info < (3, 9), "requires 3.9+") | ||
def test_trio102_py39(self): | ||
self.assert_expected_errors( | ||
"trio102_py39.py", | ||
make_error(TRIO102, 15, 12), | ||
) | ||
|
||
|
||
|
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.