From 4fcc352e76ec554c934e7fab959af6a1238bff63 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Mon, 1 Apr 2024 18:57:53 +0200 Subject: [PATCH] Apply ruff/bugbear rule B007 Loop control variable `i` not used within loop body --- pyproject.toml | 3 --- tests/test_schunk_delete.py | 4 ++-- tests/test_schunk_update.py | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b7426492..226c2839 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -58,6 +58,3 @@ extend-select = [ "I", "UP", ] -ignore = [ - "B007", -] diff --git a/tests/test_schunk_delete.py b/tests/test_schunk_delete.py index bd5c993c..2a00a7bb 100644 --- a/tests/test_schunk_delete.py +++ b/tests/test_schunk_delete.py @@ -40,7 +40,7 @@ def test_schunk_delete_numpy(contiguous, urlpath, nchunks, ndeletes): nchunks_ = schunk.append_data(buffer) assert nchunks_ == (i + 1) - for i in range(ndeletes): + for _ in range(ndeletes): pos = random.randint(0, nchunks - 1) if pos != (nchunks - 1): buff = schunk.decompress_chunk(pos + 1) @@ -84,7 +84,7 @@ def test_schunk_delete(contiguous, urlpath, nchunks, ndeletes): nchunks_ = schunk.append_data(bytes_obj) assert nchunks_ == (i + 1) - for i in range(ndeletes): + for _ in range(ndeletes): pos = random.randint(0, nchunks - 1) if pos != (nchunks - 1): buff = schunk.decompress_chunk(pos + 1) diff --git a/tests/test_schunk_update.py b/tests/test_schunk_update.py index 90794fb2..533e483a 100644 --- a/tests/test_schunk_update.py +++ b/tests/test_schunk_update.py @@ -43,7 +43,7 @@ def test_schunk_update_numpy(contiguous, urlpath, nchunks, nupdates, copy, creat nchunks_ = schunk.append_data(buffer) assert nchunks_ == (i + 1) - for i in range(nupdates): + for _ in range(nupdates): pos = random.randint(0, nchunks - 1) buffer = pos * np.arange(200 * 1000, dtype="int32") if create_chunk: @@ -95,7 +95,7 @@ def test_update(contiguous, urlpath, nchunks, nupdates, copy, create_chunk, gil) nchunks_ = schunk.append_data(bytes_obj) assert nchunks_ == (i + 1) - for i in range(nupdates): + for _ in range(nupdates): pos = random.randint(0, nchunks - 1) bytes_obj = b"i " * nbytes if create_chunk: