Skip to content
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

[anyio/asyncio].TaskGroup support for 101, 111, 112 #215

Closed
jakkdl opened this issue Mar 5, 2024 · 1 comment · Fixed by #244
Closed

[anyio/asyncio].TaskGroup support for 101, 111, 112 #215

jakkdl opened this issue Mar 5, 2024 · 1 comment · Fixed by #244

Comments

@jakkdl
Copy link
Member

jakkdl commented Mar 5, 2024

These tests are currently hardcoded to check for nurseries, but should be extended to also check anyio taskgroups. The same errors are likely relevant for asyncio as well, so can extend to asyncio taskgroups too.

Errors in question are:

  • ASYNC101: yield inside a trio/anyio nursery or cancel scope is only safe when implementing a context manager - otherwise, it breaks exception handling.
  • ASYNC111: Variable, from context manager opened inside nursery, passed to start[_soon] might be invalidly accessed while in use, due to context manager closing before the nursery. This is usually a bug, and nurseries should generally be the inner-most context manager.
  • ASYNC112: Nursery body with only a call to nursery.start[_soon] and not passing itself as a parameter can be replaced with a regular function call.
@jakkdl
Copy link
Member Author

jakkdl commented Mar 5, 2024

It's possible there are other checks where I've missed the nursery/taskgroup distinction, I'll make a pass to check for any other that seem to only handle nurseries when writing PR for the above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant