From c3262d88cc1480d492e33499d04ec8bde245b459 Mon Sep 17 00:00:00 2001 From: Hugo Osvaldo Barrera Date: Thu, 6 Nov 2025 01:05:48 +0100 Subject: [PATCH] Mark unused variables as such --- tests/storage/__init__.py | 10 +++++----- tests/storage/dav/__init__.py | 4 ++-- tests/storage/test_filesystem.py | 2 +- tests/system/cli/test_config.py | 2 +- tests/system/cli/test_utils.py | 2 +- tests/unit/sync/test_sync.py | 10 +++++----- tests/unit/test_repair.py | 2 +- vdirsyncer/storage/dav.py | 2 +- vdirsyncer/storage/google.py | 2 +- vdirsyncer/vobject.py | 2 +- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/tests/storage/__init__.py b/tests/storage/__init__.py index 53c2bb4..93046d1 100644 --- a/tests/storage/__init__.py +++ b/tests/storage/__init__.py @@ -104,7 +104,7 @@ class StorageTests: href, etag = await s.upload(get_item()) if etag is None: _, etag = await s.get(href) - ((href2, item, etag2),) = await aiostream.stream.list(s.get_multi([href] * 2)) + ((href2, _item, etag2),) = await aiostream.stream.list(s.get_multi([href] * 2)) assert href2 == href assert etag2 == etag @@ -118,7 +118,7 @@ class StorageTests: @pytest.mark.asyncio async def test_upload(self, s, get_item): item = get_item() - href, etag = await s.upload(item) + href, _etag = await s.upload(item) assert_item_equals((await s.get(href))[0], item) @pytest.mark.asyncio @@ -146,7 +146,7 @@ class StorageTests: @pytest.mark.asyncio async def test_wrong_etag(self, s, get_item): item = get_item() - href, etag = await s.upload(item) + href, _etag = await s.upload(item) with pytest.raises(exceptions.PreconditionFailed): await s.update(href, item, '"lolnope"') with pytest.raises(exceptions.PreconditionFailed): @@ -422,7 +422,7 @@ class StorageTests: ).strip() ) - href, etag = await s.upload(item) + href, _etag = await s.upload(item) - item2, etag2 = await s.get(href) + item2, _etag2 = await s.get(href) assert normalize_item(item) == normalize_item(item2) diff --git a/tests/storage/dav/__init__.py b/tests/storage/dav/__init__.py index f49362f..2ff2fcf 100644 --- a/tests/storage/dav/__init__.py +++ b/tests/storage/dav/__init__.py @@ -48,6 +48,6 @@ class DAVStorageTests(ServerMixin, StorageTests): monkeypatch.setattr(s, "_get_href", lambda item: item.ident + s.fileext) item = get_item(uid="град сатану" + str(uuid.uuid4())) - href, etag = await s.upload(item) - item2, etag2 = await s.get(href) + href, _etag = await s.upload(item) + item2, _etag2 = await s.get(href) assert_item_equals(item, item2) diff --git a/tests/storage/test_filesystem.py b/tests/storage/test_filesystem.py index b4cf9c4..d340b57 100644 --- a/tests/storage/test_filesystem.py +++ b/tests/storage/test_filesystem.py @@ -90,7 +90,7 @@ class TestFilesystemStorage(StorageTests): storage = self.storage_class(str(tmpdir), ".txt") item = Item("UID:" + "hue" * 600) - href, etag = await storage.upload(item) + href, _etag = await storage.upload(item) assert item.uid not in href @pytest.mark.asyncio diff --git a/tests/system/cli/test_config.py b/tests/system/cli/test_config.py index 16ead29..d770453 100644 --- a/tests/system/cli/test_config.py +++ b/tests/system/cli/test_config.py @@ -26,7 +26,7 @@ def read_config(tmpdir, monkeypatch): def test_read_config(read_config): - errors, c = read_config( + _errors, c = read_config( """ [general] status_path = "/tmp/status/" diff --git a/tests/system/cli/test_utils.py b/tests/system/cli/test_utils.py index 56e561b..44e7cd8 100644 --- a/tests/system/cli/test_utils.py +++ b/tests/system/cli/test_utils.py @@ -14,7 +14,7 @@ def test_handle_cli_error(capsys): except BaseException: handle_cli_error() - out, err = capsys.readouterr() + _out, err = capsys.readouterr() assert "returned something vdirsyncer doesn't understand" in err assert "ayy lmao" in err diff --git a/tests/unit/sync/test_sync.py b/tests/unit/sync/test_sync.py index bb171d8..64c960f 100644 --- a/tests/unit/sync/test_sync.py +++ b/tests/unit/sync/test_sync.py @@ -348,7 +348,7 @@ async def test_uses_get_multi(monkeypatch): a = MemoryStorage() b = MemoryStorage() item = Item("UID:1") - expected_href, etag = await a.upload(item) + expected_href, _etag = await a.upload(item) await sync(a, b, {}) assert get_multi_calls == [[expected_href]] @@ -385,7 +385,7 @@ async def test_changed_uids(): a = MemoryStorage() b = MemoryStorage() href_a, etag_a = await a.upload(Item("UID:A-ONE")) - href_b, etag_b = await b.upload(Item("UID:B-ONE")) + _href_b, _etag_b = await b.upload(Item("UID:B-ONE")) status = {} await sync(a, b, status) @@ -469,7 +469,7 @@ async def test_moved_href(): a = MemoryStorage() b = MemoryStorage() status = {} - href, etag = await a.upload(Item("UID:haha")) + _href, _etag = await a.upload(Item("UID:haha")) await sync(a, b, status) b.items["lol"] = b.items.pop("haha") @@ -530,7 +530,7 @@ async def test_unicode_hrefs(): a = MemoryStorage() b = MemoryStorage() status = {} - href, etag = await a.upload(Item("UID:äää")) + _href, _etag = await a.upload(Item("UID:äää")) await sync(a, b, status) @@ -553,7 +553,7 @@ class SyncMachine(RuleBasedStateMachine): if flaky_etags: async def get(href): - old_etag, item = s.items[href] + _old_etag, item = s.items[href] etag = _random_string() s.items[href] = etag, item return item, etag diff --git a/tests/unit/test_repair.py b/tests/unit/test_repair.py index 8f059ff..d3328da 100644 --- a/tests/unit/test_repair.py +++ b/tests/unit/test_repair.py @@ -45,7 +45,7 @@ async def test_repair_uids(uid): async def test_repair_unsafe_uids(uid): s = MemoryStorage() item = Item(f"BEGIN:VCARD\nUID:{uid}\nEND:VCARD") - href, etag = await s.upload(item) + href, _etag = await s.upload(item) assert (await s.get(href))[0].uid == uid assert not href_safe(uid) diff --git a/vdirsyncer/storage/dav.py b/vdirsyncer/storage/dav.py index 6728315..fcf5ae0 100644 --- a/vdirsyncer/storage/dav.py +++ b/vdirsyncer/storage/dav.py @@ -115,7 +115,7 @@ def _fuzzy_matches_mimetype(strict, weak): if strict is None or weak is None: return True - mediatype, subtype = strict.split("/") + _mediatype, subtype = strict.split("/") return subtype in weak diff --git a/vdirsyncer/storage/google.py b/vdirsyncer/storage/google.py index d7e44e0..a81eeb9 100644 --- a/vdirsyncer/storage/google.py +++ b/vdirsyncer/storage/google.py @@ -130,7 +130,7 @@ class GoogleSession(dav.DAVSession): async with self._session as session: # Fail fast if the address is occupied - authorization_url, state = session.authorization_url( + authorization_url, _state = session.authorization_url( TOKEN_URL, # access_type and approval_prompt are Google specific # extra parameters. diff --git a/vdirsyncer/vobject.py b/vdirsyncer/vobject.py index c609cd0..452c2d6 100644 --- a/vdirsyncer/vobject.py +++ b/vdirsyncer/vobject.py @@ -188,7 +188,7 @@ def join_collection(items, wrappers=_default_join_wrappers): """ items1, items2 = tee((_Component.parse(x) for x in items), 2) - item_type, wrapper_type = _get_item_type(items1, wrappers) + _item_type, wrapper_type = _get_item_type(items1, wrappers) wrapper_props = [] def _get_item_components(x):