Execute one assertion per line

This commit is contained in:
Hugo Osvaldo Barrera 2025-08-29 12:48:52 +02:00
parent a4d4bf8fd1
commit 1502f5b5f4
4 changed files with 14 additions and 7 deletions

View file

@ -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):

View file

@ -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:

View file

@ -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

View file

@ -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,