Files
hatchet/sdks/python/conftest.py
Matt Kaye 1eeb8e915d Fix: Queue blocking on many concurrency keys + failures (#1622)
* fix: move around case ordering

* feat: move worker fixture around

* fix: clean up fixtures

* feat: expand test, try to repro

* debug: more minimal repro

* fix: bug bashing

* fix: factor out concurrency queries into overwrite

* feat: improve test

* fix: improve test

* fix: lint

* feat: migration for trigger

* Fix: Retry + Cancel Bugs (#1620)

* fix: send original retry count to cancel

* fix: key threads, contexts, and tasks on retry count

* fix: store the key on the action and use it everywhere

* refactor: signature consistency

* fix: instrumentor types

* chore: version

* feat: comment

* fix: thank you mypy

* fix: simplify callback

* fix: ts implementation

* chore: lint

* fix: rework how retries are passed

* Fix: Add Retries to Log Pushes (#1594)

* fix: retry log pushes

* chore: version
2025-04-25 21:49:30 -04:00

33 lines
876 B
Python

from subprocess import Popen
from typing import AsyncGenerator, Generator, cast
import pytest
import pytest_asyncio
from pytest import FixtureRequest
from hatchet_sdk import Hatchet
from tests.worker_fixture import hatchet_worker
@pytest_asyncio.fixture(scope="session", loop_scope="session")
async def hatchet() -> AsyncGenerator[Hatchet, None]:
yield Hatchet(
debug=True,
)
@pytest.fixture(scope="session", autouse=True)
def worker() -> Generator[Popen[bytes], None, None]:
command = ["poetry", "run", "python", "examples/worker.py"]
with hatchet_worker(command) as proc:
yield proc
@pytest.fixture(scope="session")
def on_demand_worker(request: FixtureRequest) -> Generator[Popen[bytes], None, None]:
command, port = cast(tuple[list[str], int], request.param)
with hatchet_worker(command, port) as proc:
yield proc