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)

License

MIT

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.19.1.tar.gz (85.9 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.19.1-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for pytest_beartype_tests-2026.4.19.1.tar.gz
Algorithm Hash digest
SHA256 02662a7c189666eac26d5994d8d750106c73b0cd31ed0d01222db59ba1cb6e5a
MD5 fb406e997d405ae016faf76ac9dce9f7
BLAKE2b-256 4c852a4abab012ea412757aee0c77a63759c9df997456ae75dc0a590071bf11d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_beartype_tests-2026.4.19.1.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.19.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_beartype_tests-2026.4.19.1-py3-none-any.whl
Algorithm Hash digest
SHA256 20618dd92dc2c8e1cab94f5984a382c95d03376ef94558e54665908e56ad8cc4
MD5 fba9ede2365105e0f2a5a04d12191eba
BLAKE2b-256 d2c08c57af81595948ddab76b78635931ed5adac38fc46565e8419dc3a5046b3

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_beartype_tests-2026.4.19.1-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