Skip to content

This release adds fixture assertion hooks that enable post-test validation of side effects while fixtures remain active. Assertion results are tracked separately in the run summary.

Fixture assertion hooks for post-test validation

Section titled “Fixture assertion hooks for post-test validation”

Feb 18, 2026 · @mavam, @codex · #27

Fixtures can now define assertion hooks that run after test execution completes while fixtures remain active. Define assertions using the assertions parameter with a frozen dataclass type, then pass fixture-specific assertion payloads under assertions.fixtures.<name> in test frontmatter. The framework automatically invokes the assert_test hook with assertion data before tearing down fixtures, letting you validate side effects like HTTP requests or log output.

Example usage with an HTTP fixture:

fixtures: [http]
assertions:
fixtures:
http:
count: 1
method: POST
path: /api/endpoint
body: '{"key":"value"}'

The HTTP fixture receives the typed assertion payload and validates that the expected request was received. Payload structure is fixture-defined, so fixtures can choose flat fields or nested schemas as needed.

Assertion checks are tracked separately from test counts in the run summary as pass/fail check metrics, so fixture-level validations are visible without changing total test counts.