Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ Semantic versioning in our case means:
But, in the future we might change the configuration names/logic,
change the client facing API, change code conventions significantly, etc.

## WIP

### Bugfixes

- Fixes false positive `WPS457` for ``while True`` loop with ``await`` expressions, #3753


## 1.5.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ def wrapper():
...
"""

correct_while7 = """
async def worker():
while True:
await asyncio.sleep(1)
"""

# Do raise:

wrong_while1 = """
Expand Down Expand Up @@ -166,6 +172,7 @@ def test_correct_while_loops_with_statements(
correct_while4,
correct_while5,
correct_while6,
correct_while7,
],
)
def test_correct_while_loops_with_try(
Expand Down
1 change: 1 addition & 0 deletions wemake_python_styleguide/visitors/ast/loops.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ class WrongLoopVisitor(base.BaseNodeVisitor):
ast.Raise,
# We only check for `try/except`, not `try/finally`:
ast.ExceptHandler,
ast.Await,
)

_containers: ClassVar[_ContainerSpec] = {
Expand Down