Synopsis
Behavior
- Discover the project from the current directory.
- Select the suites to run. With no target, every existing suite directory in order:
tests/(the actor, through the SDK’s simulated host) andoffchain/tests/(ordinary Python). With a target, exactlytests/test_<target>.py. - Locate the project’s
uvand runuv run --no-config --no-sync pytest <paths>from the project root withUV_PROJECT_ENVIRONMENTset to.venv.VIRTUAL_ENV,PYTHONHOME, andPYTHONPATHare removed from the child’s environment. - Print pytest’s report on stdout and its diagnostics on stderr, then exit with pytest’s own exit code so CI can use it.
--json, pytest’s report goes to stderr and stdout carries one envelope whose result has paths, target (when given), passed, failed, errors, skipped, exit_code, and ok. The counts are read from pytest’s final summary line; the exit code, not the counts, decides the verdict.
Flags
Example
Edge Cases
- A project with no suite at all fails with exit code 1 and the
tests_not_founddiagnostic; a deleted suite is not a passing one. - Naming a target whose
tests/test_<target>.pydoes not exist fails withtests_not_scoped; runcowboy testwith no target to run everything. - Naming a target the project does not declare fails with
target_not_found. cowboy testneedsuv; it fails before running anything if it cannot be found.