pytest-asyncioauto mode. Async test functions do not require@pytest.mark.asyncio. The setting lives inpyproject.tomlunder[tool.pytest.ini_options].httpx2.MockTransportfor transport mocking, notrespx. Tests constructhttpx2.AsyncClient(transport=httpx2.MockTransport(handler))and pass it ashttpx2_client=toAsyncClient(or the sync equivalenthttpx2.Client(transport=httpx2.MockTransport(handler))toClient).MockTransportis a first-partyhttpx2API;respxtargetshttpx(nothttpx2) and patches its internals directly — seedocs/testing.mdfor why.- Hypothesis property-based tests for concurrency-sensitive code:
RetryBudget,Bulkhead, retry interleaving. Files are namedtest_*_props.pyso they are easy to grep and treat separately in CI. - Benchmarks are standalone scripts, not pytest tests. Performance characterization (e.g.
benchmarks/contention.py) lives underbenchmarks/(coverage-omitted viarun.omit), run explicitly and never gated in CI — shared-runner perf is too noisy to gate on. stressmarker for free-threading proof. Registered inpyproject.toml,stress-marked tests drive real thread parallelism (ThreadPoolExecutor, shared instances, high iteration counts, invariant-not-timing assertions) againsthttpware's Lock/Semaphore-based components and the sharedhttpx2connection pool. They run in the default suite too, so they count toward coverage under the GIL — but the GIL serializes bytecode execution, so a GIL run only exercises the code path, it does not prove thread-safety. That proof comes from thepytest-freethreadedCI job, which runs the full suite on free-threaded CPython3.14twith the GIL disabled (the job assertssys._is_gil_enabled()is False in a shell step before running the suite).3.13tis deferred — seeplanning/deferred.md— pending an msgspec cp313t wheel.- Coverage is 100% line coverage. New code is expected to maintain this.