CodeVetter · Repo Unpack · System map
pytest-dev/pytest
The runtime is a Python library and command-line test runner distributed as a package. Public APIs are collected in pytest, while most implementation lives in _pytest modules registered as plugins. Config, Session, fixture definitions, and report consumers own different stages of a run. Packaging, documentation hosting, release automation, and maintenance jobs form separate operational boundaries.
- Both pytest and py.test console scripts target _pytest.config:_console_main; python -m pytest calls that same function and raises SystemExit with its result.
- src/pytest/__init__.py exposes Config, Session, collectors, fixtures, assertion helpers, reports, and plugin decorators by importing their implementations from _pytest.
- get_config constructs a fresh PytestPluginManager and Config per invocation, processes plugin exclusions first, then imports default_plugins.
- wrap_session owns session configuration, startup, exception-to-exit-status handling, working-directory restoration, sessionfinish, and unconfiguration.
- Persistent state includes JSON Cache values, assertion-rewritten bytecode, and temporary directories; these have distinct formats and lifecycle owners.
- Packaging uses setuptools.build_meta and setuptools-scm, requires Python >=3.10, and declares pluggy, iniconfig, packaging, pygments, and conditional compatibility dependencies.
- tox defines wheel-based test environments, pre-commit linting, Sphinx documentation builds, and separate plugin integration checks; Read the Docs builds documentation with Python 3.14.
- Operational entrypoints include manual release-PR preparation and package deployment, weekly documentation link checking and plugin-list updates, and scheduled closure of needs-information issues.