{"id":28106,"library":"pytest-beartype-tests","title":"pytest-beartype-tests","description":"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.","status":"active","version":"2026.4.26","language":"python","source_language":"en","source_url":"https://github.com/adamtheturtle/pytest-beartype-tests","tags":["pytest","beartype","type-checking","testing","plugin"],"install":[{"cmd":"pip install pytest-beartype-tests","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Core runtime type-checking library","package":"beartype","optional":false},{"reason":"Required test framework","package":"pytest","optional":false}],"imports":[{"note":"Plugin is auto-discovered; explicit import not needed.","wrong":"from pytest_beartype_tests import *","symbol":"pytest_beartype_tests","correct":"import pytest_beartype_tests"}],"quickstart":{"code":"# test_example.py\nimport pytest\n\ndef test_addition(a: int, b: int) -> int:\n    return a + b\n\n# Run with: pytest --beartype-tests\n","lang":"python","description":"Enable beartype checking on all test functions by passing --beartype-tests to pytest."},"warnings":[{"fix":"Use --beartype-tests-skip to selectively disable for certain directories.","message":"Automatic application of @beartype may slow down test collection for large test suites.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure all test functions have appropriate type annotations or use @beartype.skip on specific functions.","message":"The plugin applies beartype to ALL collected test functions, including fixtures and conftest hooks, which can cause unexpected failures if those functions lack annotations.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"pip install beartype","cause":"Missing beartype dependency","error":"ModuleNotFoundError: No module named 'beartype'"},{"fix":"Install pytest-beartype-tests via pip; ensure it's in the same environment.","cause":"Plugin not installed or not activated in pytest","error":"pytest: error: unrecognized arguments: --beartype-tests"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}