--- id: pytest-beartype-tests version: "2026.4.26" license: MIT License Copyright (c) 2026 Adam Dangoor Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal… (full text in the JSON record) license_treatment: permissive maintenance: active --- # pytest-beartype-tests — Pytest plugin that applies @beartype to every collected test function. License: permissive · Maintenance: active · Downloads: 139.9K/mo ## What it is and what it does pytest-beartype-tests is a minimal pytest plugin that wraps every collected test function with beartype's runtime type-checking decorator. It catches type violations in test signatures and any locally-typed variables inside test bodies at runtime, without requiring manual decorator application to each test. The plugin auto-registers via pytest's entry point system and requires no configuration. It is explicitly positioned as a temporary workaround until pytest-beartype 0.3.0 is released with native support for this functionality. The package depends on beartype and pytest, both of which are standard in Python testing workflows. Use it for: - Catch type mismatches in test function parameters before test logic runs, surfacing contract violations early. - Validate locally-typed variables within test bodies to ensure test code itself respects its own type hints. - Add runtime type safety to test suites without manually decorating every test function with @beartype. - Detect when test fixtures or parametrized inputs violate expected types before assertions are evaluated. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A pytest plugin that automatically applies runtime type-checking via beartype to every collected test function, catching type violations in test signatures and locally-typed variables during test execution. Yes, if you want automatic runtime type-checking on test functions with minimal setup. Install friction is low and the plugin is actively maintained. However, be aware this is a temporary workaround for functionality expected in pytest-beartype 0.3.0—plan to migrate when that release arrives. The project is very new with minimal adoption, so edge cases may not be well-tested. ## Install pip install pytest-beartype-tests uv add pytest-beartype-tests poetry add pytest-beartype-tests ## Installing pytest-beartype-tests Before you install: Low install friction with only two runtime dependencies (beartype and pytest). Active maintenance with a recent commit on 2026-08-13, though the project is new (first release 2026-04-19) and has minimal adoption signals (2 stars). License in practice: MIT License permits unrestricted use, modification, and distribution with only attribution required—no restrictions on commercial or proprietary use. Quickstart: # Install pip install pytest-beartype-tests # In your test file, just write normally with type hints: def test_example(x: int) -> None: assert x > 0 # Run pytest; the plugin auto-registers and applies beartype to all test functions pytest test_example.py Requires Python 3.11 or later; the plugin auto-registers via pytest11 entry point with no configuration needed. Verify before relying: - Whether the plugin works with pytest fixtures and parameterized tests beyond basic function signatures. - Performance overhead of applying beartype to every test function in large test suites. - Compatibility with other pytest plugins that also modify test collection or execution. - Whether this plugin will be superseded by pytest-beartype 0.3.0 as documented, and on what timeline. ## Package facts - License: MIT License Copyright (c) 2026 Adam Dangoor Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal… (full text in the JSON record) (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 139.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags pytest type checking plugin, runtime type validation tests, beartype pytest integration, test function type enforcement, pytest type annotations, type-checking, pytest-plugin, testing-tools [View on SkillFed](https://skillfed.io/packages/pytest-beartype-tests) · [View on PyPI](https://pypi.org/project/pytest-beartype-tests/)