Registry / testing / pytest-beartype-tests

pytest-beartype-tests

JSON →
library2026.4.26pypypi✓ verified 86d ago

A Pytest plugin that automatically applies @beartype to every collected test function at runtime, enabling runtime type-checking of test arguments and return values. The current version is 2026.04.26, with a rapid release cadence tied to calendar dates.

pip install pytest-beartype-tests
INSTALL
IMPORT
SIG · PYTEST-BEARTYPE-TE
P
pytest-beartype-tests
testingpythonv2026.4.26
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

pytest_beartype_tests
import pytest_beartype_tests
from pytest_beartype_tests import *
Plugin is auto-discovered; explicit import not needed.

Enable beartype checking on all test functions by passing --beartype-tests to pytest.

# test_example.py import pytest def test_addition(a: int, b: int) -> int: return a + b # Run with: pytest --beartype-tests
Debug
Known issues
gotchaAutomatic application of @beartype may slow down test collection for large test suites.
fix
Use --beartype-tests-skip to selectively disable for certain directories.
affects: all
gotchaThe plugin applies beartype to ALL collected test functions, including fixtures and conftest hooks, which can cause unexpected failures if those functions lack annotations.
fix
Ensure all test functions have appropriate type annotations or use @beartype.skip on specific functions.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'beartype'
Missing beartype dependency
fix
pip install beartype
pytest: error: unrecognized arguments: --beartype-tests
Plugin not installed or not activated in pytest
fix
Install pytest-beartype-tests via pip; ensure it's in the same environment.
Upgrade
Version history
2026.4.26latest on PyPI · released Apr 26, 2026
Audit
Dependencies
beartyperequiredCore runtime type-checking library
pytestrequiredRequired test framework
Agent activity
19 hits · last 30 days
node
16
OpenAI (training)
2
Resources
pytest-beartype-tests — pip install pytest-beartype-tests · libregistry