fix: replace assert with RuntimeError for missing startup and document lifecycle requirement (#16)

This commit is contained in:
d3vyce
2026-05-04 19:09:32 +02:00
committed by GitHub
parent 84fff031df
commit 66b418bff1
2 changed files with 14 additions and 2 deletions
+6
View File
@@ -326,3 +326,9 @@ class TestLifecycle:
async def test_shutdown_without_startup_is_safe(self):
mw = RedisDeduplicationMiddleware(redis_url="redis://localhost")
await mw.shutdown()
@pytest.mark.anyio
async def test_pre_send_without_startup_raises_runtime_error(self, make_message):
mw = RedisDeduplicationMiddleware(redis_url="redis://localhost")
with pytest.raises(RuntimeError, match="startup"):
await mw.pre_send(make_message())