-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
ruleImplementing or modifying a lint ruleImplementing or modifying a lint rule
Description
What's wrong
I want to test that async iterator raises error.
with pytest.raises(KeyError, match='unknown'):
async for _ in gpt.generate(gpt_request):
passReceive unexpected error PT012 'pytest.raises()' block should contain a single simple statement, but the statement is already simple.
How it should work
not raise PT012 for simple async for loops as with empty context managers https://github.com/m-burst/flake8-pytest-style/blob/master/docs/rules/PT012.md
System information
- Operating system: mac OS Ventura 13.5
- Python version: 3.11.4
- ruff version: v0.1.9
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
ruleImplementing or modifying a lint ruleImplementing or modifying a lint rule