Skip to content

Use pytest-beartype-tests plugin#1335

Merged
adamtheturtle merged 3 commits intomainfrom
use-pytest-beartype-tests-plugin
Apr 19, 2026
Merged

Use pytest-beartype-tests plugin#1335
adamtheturtle merged 3 commits intomainfrom
use-pytest-beartype-tests-plugin

Conversation

@adamtheturtle
Copy link
Copy Markdown
Member

@adamtheturtle adamtheturtle commented Apr 19, 2026

This PR adds the pytest-beartype-tests dev dependency and removes redundant pytest_collection_modifyitems / @beartype wiring from conftest where it duplicated the plugin.

The plugin registers via pytest11 and applies @beartype to collected test functions, matching the previous local hook behavior (see the upstream README).


Note

Low Risk
Low risk: this only changes test-time type checking wiring by delegating @beartype application to an external pytest plugin, so impact is limited to how tests are collected/executed.

Overview
Moves beartype enforcement for tests from a custom pytest_collection_modifyitems hook in tests/conftest.py to the pytest-beartype-tests plugin.

Adds pytest-beartype-tests as a dev dependency (with a uv git source pin) and removes the now-redundant local beartype import/hook, plus drops the related Vulture ignore entry.

Reviewed by Cursor Bugbot for commit 573dbe7. Bugbot is set up for automated code reviews on this repo. Configure here.

Replace manual pytest_collection_modifyitems hooks with the
https://github.com/adamtheturtle/pytest-beartype-tests dev dependency.
Use git+https dependency until the next PyPI release includes
adamtheturtle/pytest-beartype-tests@bc81d99.
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 573dbe7. Configure here.

Comment thread pyproject.toml
"pyright==1.1.408",
"pyroma==5.0.1",
"pytest==9.0.3",
"pytest-beartype-tests",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unpinned non-PyPI dependency breaks pip-based dev install

Medium Severity

pytest-beartype-tests is added to optional-dependencies.dev without a version pin and does not appear to be published on PyPI — it's only resolvable via the uv-specific [tool.uv] git source. Every other dev dependency has an explicit version pin. The project's contributing docs (docs/source/contributing.rst) instruct contributors to run pip install --editable '.[dev]', which will now fail because pip doesn't read [tool.uv.sources] and can't find the package on PyPI.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 573dbe7. Configure here.

@adamtheturtle adamtheturtle merged commit e8cdb92 into main Apr 19, 2026
30 checks passed
@adamtheturtle adamtheturtle deleted the use-pytest-beartype-tests-plugin branch April 19, 2026 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant