Skip to main content

Pytest plugin that applies @beartype to every collected test function.

Project description

A tiny pytest plugin that applies beartype to every collected test function, giving you runtime type-checking of test signatures and any locally-typed variables inside the test body.

This is distinct from pytest-beartype, which beartypes your source packages. This plugin beartypes the tests themselves.

Install

uv add --dev pytest-beartype-tests

The plugin auto-registers via the pytest11 entry point — there is no configuration.

What it does

Equivalent to writing this hook in your conftest.py:

import pytest
from beartype import beartype


def pytest_collection_modifyitems(items: list[pytest.Function]) -> None:
    for item in items:
        item.obj = beartype(obj=item.obj)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest_beartype_tests-2026.4.20.tar.gz (86.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_beartype_tests-2026.4.20-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file pytest_beartype_tests-2026.4.20.tar.gz.

File metadata

File hashes

Hashes for pytest_beartype_tests-2026.4.20.tar.gz
Algorithm Hash digest
SHA256 73b10d64c5605809444469250c3ccc8b4ddbf788772be84f0ee0ac3f58460ccf
MD5 d8751ee7184905050acf25aea3f85a90
BLAKE2b-256 6a0ef3b3980efe46c7655ce2820fe56189490f9c1e6ed5cb42b35999b4ba8238

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_beartype_tests-2026.4.20.tar.gz:

Publisher: release.yml on adamtheturtle/pytest-beartype-tests

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytest_beartype_tests-2026.4.20-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_beartype_tests-2026.4.20-py3-none-any.whl
Algorithm Hash digest
SHA256 e61e7bd87443f92c89f125cc8a7284665c5137e953ecd91031be1620ba07c1d8
MD5 aa96e4e00a20581b4446614ee6fdfca9
BLAKE2b-256 9542ee5023bf416be8ffc276a08e42eac10aee1903142a1e25ceea24cc766b73

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_beartype_tests-2026.4.20-py3-none-any.whl:

Publisher: release.yml on adamtheturtle/pytest-beartype-tests

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page