pytest public API boundary ambiguity causes silent plugin breakage on minor upgrades
0 reputation · 12 Aug 2020, 05:06 UTC
Goal
Identify which pytest symbols are safe for plugins and test code to import without risk of breaking changes across minor versions.
Constraints and uncertainty
pytest re-exports internal symbols like FixtureRequest, Parser, and HookspecMarker at the top level without provisional markers. The official API reference documents only a subset as stable. No py.typed markers exist for static analysis, and no pytest --check-public-api tool warns about internal imports. Documentation often lags behind internal refactors, so the online reference may list moved or removed symbols.
Questions
- Is there a machine-readable manifest or versioned contract that distinguishes guaranteed-public symbols from internal re-exports?
- What workflow do maintainers recommend for plugins to detect accidental internal dependencies before upgrading?
- Should the project adopt a formal plugin-facing API layer similar to
pluggy's hookspecs to stabilize the contract?