Skip to content

Expose CaptureManager as public API (#14186)#14662

Open
Aditya-Tripuraneni wants to merge 1 commit into
pytest-dev:mainfrom
Aditya-Tripuraneni:feat/14186-expose-capturemanager
Open

Expose CaptureManager as public API (#14186)#14662
Aditya-Tripuraneni wants to merge 1 commit into
pytest-dev:mainfrom
Aditya-Tripuraneni:feat/14186-expose-capturemanager

Conversation

@Aditya-Tripuraneni

Copy link
Copy Markdown
Contributor

Expose CaptureManager as a public API type.

This exposes CaptureManager via pytest.CaptureManager so plugin authors can annotate capture-manager lookups without importing from
_pytest.capture.

Tests and validation:

  • Added a runtime API test in testing/test_capture.py to verify pytest.CaptureManager is CaptureManager.
  • Added a typing regression check in testing/typing_checks.py to verify plugin-style annotation with pytest.CaptureManager.
  • Verified with uv run --python 3.10 pytest testing/test_capture.py -k capture_manager_is_public_api.
  • Verified with uv run --python 3.10 --with mypy mypy testing/typing_checks.py.

Closes #14186

@psf-chronographer psf-chronographer Bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Jun 29, 2026
@Aditya-Tripuraneni

Copy link
Copy Markdown
Contributor Author

Bit of an old issue, but I think I have a fix for it. Tests verify no typing regressions as well since that was a concern.

Mind taking a review whenever you have some time? @RonnyPfannschmidt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided (automation) changelog entry is part of PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose CaptureManager as public API

1 participant