Files
hatchet/sdks/python/examples/lifespans/test_lifespans.py
Matt Kaye 90805ca763 Feat: Lifespans! (#1541)
* feat: implement lifespans

* feat: add psycopg test dep

* feat: lifespan script

* feat: examples and tests

* drive-by: add license

* drive-by: throw errors for sanity checks

* feat: docs

* feat: sync and async

* fix: docs

* fix: lint

* fix: small tweaks

* fix: rm unused

* fix: typed example

* fix: print
2025-04-14 08:56:39 -04:00

13 lines
302 B
Python

import pytest
from examples.lifespans.simple import Lifespan, lifespan_task
@pytest.mark.asyncio(loop_scope="session")
async def test_lifespans() -> None:
result = await lifespan_task.aio_run()
assert isinstance(result, Lifespan)
assert result.pi == 3.14
assert result.foo == "bar"