From d727d85f6dc48d3beca4b90dec81c89775790aca Mon Sep 17 00:00:00 2001 From: link2xt Date: Fri, 25 Aug 2023 20:57:44 +0000 Subject: [PATCH] chore(python): fix `ruff` 0.0.286 warnings --- python/src/deltachat/account.py | 2 +- python/src/deltachat/cutil.py | 2 +- python/tests/bench_test_setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python/src/deltachat/account.py b/python/src/deltachat/account.py index 8272dc965..fde031564 100644 --- a/python/src/deltachat/account.py +++ b/python/src/deltachat/account.py @@ -427,7 +427,7 @@ class Account: assert dc_chatlist != ffi.NULL chatlist = [] - for i in range(0, lib.dc_chatlist_get_cnt(dc_chatlist)): + for i in range(lib.dc_chatlist_get_cnt(dc_chatlist)): chat_id = lib.dc_chatlist_get_chat_id(dc_chatlist, i) chatlist.append(Chat(self, chat_id)) return chatlist diff --git a/python/src/deltachat/cutil.py b/python/src/deltachat/cutil.py index ad9810219..f907166b9 100644 --- a/python/src/deltachat/cutil.py +++ b/python/src/deltachat/cutil.py @@ -15,7 +15,7 @@ def as_dc_charpointer(obj): def iter_array(dc_array_t, constructor: Callable[[int], T]) -> Generator[T, None, None]: - for i in range(0, lib.dc_array_get_cnt(dc_array_t)): + for i in range(lib.dc_array_get_cnt(dc_array_t)): yield constructor(lib.dc_array_get_id(dc_array_t, i)) diff --git a/python/tests/bench_test_setup.py b/python/tests/bench_test_setup.py index 5dc5e3877..ef750550f 100644 --- a/python/tests/bench_test_setup.py +++ b/python/tests/bench_test_setup.py @@ -15,6 +15,6 @@ class TestEmpty: def test_prepare_setup_measurings(self, acfactory): acfactory.get_online_accounts(BENCH_NUM) - @pytest.mark.parametrize("num", range(0, BENCH_NUM + 1)) + @pytest.mark.parametrize("num", range(BENCH_NUM + 1)) def test_setup_online_accounts(self, acfactory, num): acfactory.get_online_accounts(num)