From 1502f5b5f44580bc98d604380019585f24040bcb Mon Sep 17 00:00:00 2001 From: Hugo Osvaldo Barrera Date: Fri, 29 Aug 2025 12:48:52 +0200 Subject: [PATCH] Execute one assertion per line --- tests/storage/test_filesystem.py | 3 ++- tests/unit/sync/test_sync.py | 9 ++++++--- tests/unit/test_metasync.py | 6 ++++-- tests/unit/utils/test_vobject.py | 3 ++- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/tests/storage/test_filesystem.py b/tests/storage/test_filesystem.py index ca7e9d3..b4cf9c4 100644 --- a/tests/storage/test_filesystem.py +++ b/tests/storage/test_filesystem.py @@ -48,7 +48,8 @@ class TestFilesystemStorage(StorageTests): s = self.storage_class(str(tmpdir), ".txt") await s.upload(Item("UID:a/b/c")) (item_file,) = tmpdir.listdir() - assert "/" not in item_file.basename and item_file.isfile() + assert "/" not in item_file.basename + assert item_file.isfile() @pytest.mark.asyncio async def test_ignore_tmp_files(self, tmpdir): diff --git a/tests/unit/sync/test_sync.py b/tests/unit/sync/test_sync.py index c6c3101..bb171d8 100644 --- a/tests/unit/sync/test_sync.py +++ b/tests/unit/sync/test_sync.py @@ -98,7 +98,8 @@ async def test_read_only_and_prefetch(): await sync(a, b, status, force_delete=True) await sync(a, b, status, force_delete=True) - assert not items(a) and not items(b) + assert not items(a) + assert not items(b) @pytest.mark.asyncio @@ -226,7 +227,8 @@ async def test_insert_hash(): await a.update(href, Item("UID:1\nHAHA:YES"), etag) await sync(a, b, status) - assert "hash" in status["1"][0] and "hash" in status["1"][1] + assert "hash" in status["1"][0] + assert "hash" in status["1"][1] @pytest.mark.asyncio @@ -665,7 +667,8 @@ class SyncMachine(RuleBasedStateMachine): except ActionIntentionallyFailed: pass except BothReadOnly: - assert a.read_only and b.read_only + assert a.read_only + assert b.read_only assume(False) except StorageEmpty: if force_delete: diff --git a/tests/unit/test_metasync.py b/tests/unit/test_metasync.py index ba17dd2..adeae03 100644 --- a/tests/unit/test_metasync.py +++ b/tests/unit/test_metasync.py @@ -35,7 +35,8 @@ async def test_basic(monkeypatch): await a.set_meta("foo", None) await metasync(a, b, status, keys=["foo"]) - assert await a.get_meta("foo") is None and await b.get_meta("foo") is None + assert await a.get_meta("foo") is None + assert await b.get_meta("foo") is None await a.set_meta("foo", "bar") await metasync(a, b, status, keys=["foo"]) @@ -54,7 +55,8 @@ async def test_basic(monkeypatch): await b.set_meta("foo", None) await metasync(a, b, status, keys=["foo"]) - assert not await a.get_meta("foo") and not await b.get_meta("foo") + assert not await a.get_meta("foo") + assert not await b.get_meta("foo") @pytest_asyncio.fixture diff --git a/tests/unit/utils/test_vobject.py b/tests/unit/utils/test_vobject.py index 10894e8..9a97303 100644 --- a/tests/unit/utils/test_vobject.py +++ b/tests/unit/utils/test_vobject.py @@ -335,7 +335,8 @@ class VobjectMachine(RuleBasedStateMachine): assert key in c assert c.get(key) == value dump = "\r\n".join(c.dump_lines()) - assert key in dump and value in dump + assert key in dump + assert value in dump @rule( c=Parsed,