Skip to content

Ruff linter: enable rule UP028 #13048

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
3 changes: 1 addition & 2 deletions localstack-core/localstack/services/sqs/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,7 @@ def __init__(self) -> None:

def iter_queues(self) -> Iterable[SqsQueue]:
for account_id, region, store in sqs_stores.iter_stores():
for queue in store.queues.values():
yield queue
yield from store.queues.values()

def do_update_all_queues(self):
for queue in self.iter_queues():
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ ignore = [
"T201", # TODO `print` found
"T203", # TODO `pprint` found
"UP008",# TODO Use `super()` instead of `super(__class__, self)`
"UP028",# TODO Replace `yield` over `for` loop with `yield from`
"UP031",# TODO Use format specifiers instead of percent format
"UP036",# TODO Version block is outdated for minimum Python version
"UP038",# TODO Use `X | Y` in `isinstance` call instead of `(X, Y)`
Expand Down
6 changes: 2 additions & 4 deletions tests/integration/aws/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ def test_chunked_response_streaming(self, cleanups):
chunks = [bytes(f"{n:2}", "utf-8") for n in range(0, 100)]

def chunk_generator():
for chunk in chunks:
yield chunk
yield from chunks

def stream_response_handler(_request) -> Response:
return Response(response=chunk_generator())
Expand All @@ -133,8 +132,7 @@ def handler(request: Request) -> Response:
cleanups.append(lambda: ROUTER.remove(rule))

def chunk_generator():
for chunk in chunks:
yield chunk
yield from chunks

response = requests.post(
config.internal_service_url() + "/_test/test_chunked_request", data=chunk_generator()
Expand Down
3 changes: 1 addition & 2 deletions tests/unit/http_/test_asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,7 @@ def __init__(self, data: list[bytes]):
self.closed = False

def __iter__(self):
for packet in self.data:
yield packet
yield from self.data

def close(self):
# should be called through the werkzeug layers
Expand Down
6 changes: 2 additions & 4 deletions tests/unit/http_/test_hypercorn.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@ def handler(request: WerkzeugRequest) -> Response:
proxy_server = ProxyServer(httpserver.url_for("/"), gateway_listen, use_ssl=True)

def chunk_generator():
for chunk in chunks:
yield chunk
yield from chunks

with server_context(proxy_server):
response = requests.get(
Expand All @@ -121,8 +120,7 @@ def test_proxy_server_with_streamed_response(httpserver):
chunks = [bytes(f"{n:2}", "utf-8") for n in range(0, 100)]

def chunk_generator():
for chunk in chunks:
yield chunk
yield from chunks

def stream_response_handler(_: WerkzeugRequest) -> Response:
return Response(response=chunk_generator())
Expand Down
3 changes: 1 addition & 2 deletions tests/unit/state/test_pickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ def __init__(self, n: int):
self.gen = self._count()

def _count(self):
for i in range(self.n):
yield i
yield from range(self.n)


class SubclassWithGenerator(ClassWithGenerator):
Expand Down
Loading