# Risk map — pytest-dev/pytest

> Canonical page: https://codevetter.com/unpack/pytest/risk-map

# Risk map — pytest-dev/pytest

Scanned commit 2887015cade4757385308e7a7d8083557fc637e2 (2026-09-29). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

The following are source observations and explicitly labeled hypotheses, not confirmed vulnerabilities. pytest intentionally imports and executes selected tests, plugins, and conftests in the invoking process. Filesystem boundaries include configurable cache directories, temporary roots, bytecode caches, and report destinations. Lifecycle and compatibility changes have a broad impact because plugins share internal execution and reporting hooks.
- Plugin autoload and explicit plugin imports execute installed or selected Python code; disabling pytest11 autoload still permits explicitly requested PYTEST_PLUGINS, and test modules are imported during collection. — [src/_pytest/config/__init__.py#L1709-L1719](https://github.com/pytest-dev/pytest/blob/2887015cade4757385308e7a7d8083557fc637e2/src/_pytest/config/__init__.py#L1709-L1719) [src/_pytest/python.py#L521-L533](https://github.com/pytest-dev/pytest/blob/2887015cade4757385308e7a7d8083557fc637e2/src/_pytest/python.py#L521-L533) [src/_pytest/python.py#L573-L574](https://github.com/pytest-dev/pytest/blob/2887015cade4757385308e7a7d8083557fc637e2/src/_pytest/python.py#L573-L574)
- TempPathFactory.getbasetemp removes an existing explicitly supplied basetemp before recreating it; the default path lies under a system or PYTEST_DEBUG_TEMPROOT directory and includes ownership and symlink checks where UID information is available. — [src/_pytest/tmpdir.py#L150-L158](https://github.com/pytest-dev/pytest/blob/2887015cade4757385308e7a7d8083557fc637e2/src/_pytest/tmpdir.py#L150-L158) [src/_pytest/tmpdir.py#L169-L205](https://github.com/pytest-dev/pytest/blob/2887015cade4757385308e7a7d8083557fc637e2/src/_pytest/tmpdir.py#L169-L205)
- Cache keys receive lexical containment validation, but _join_within does not resolve symlinks; hypothesis: protection against traversal through pre-existing filesystem links requires separate assessment. (inferred) — [src/_pytest/cacheprovider.py#L165-L176](https://github.com/pytest-dev/pytest/blob/2887015cade4757385308e7a7d8083557fc637e2/src/_pytest/cacheprovider.py#L165-L176) [src/_pytest/cacheprovider.py#L198-L217](https://github.com/pytest-dev/pytest/blob/2887015cade4757385308e7a7d8083557fc637e2/src/_pytest/cacheprovider.py#L198-L217)
- Cache.set writes JSON directly to the destination, whereas cache-directory initialization and rewritten bytecode use rename/replace operations; hypothesis: concurrent independent cache writers can overwrite state or expose partial JSON, which readers then treat as a miss. (inferred) — [src/_pytest/cacheprovider.py#L59-L87](https://github.com/pytest-dev/pytest/blob/2887015cade4757385308e7a7d8083557fc637e2/src/_pytest/cacheprovider.py#L59-L87) [src/_pytest/cacheprovider.py#L214-L243](https://github.com/pytest-dev/pytest/blob/2887015cade4757385308e7a7d8083557fc637e2/src/_pytest/cacheprovider.py#L214-L243) [src/_pytest/assertion/rewrite.py#L314-L326](https://github.com/pytest-dev/pytest/blob/2887015cade4757385308e7a7d8083557fc637e2/src/_pytest/assertion/rewrite.py#L314-L326)
- --pastebin=all uploads collected terminal output and --pastebin=failed uploads failure representations to https://bpa.st; create_new_paste calls urlopen without an explicit timeout and the feature emits a deprecation warning. — [src/_pytest/pastebin.py#L35-L73](https://github.com/pytest-dev/pytest/blob/2887015cade4757385308e7a7d8083557fc637e2/src/_pytest/pastebin.py#L35-L73) [src/_pytest/pastebin.py#L76-L102](https://github.com/pytest-dev/pytest/blob/2887015cade4757385308e7a7d8083557fc637e2/src/_pytest/pastebin.py#L76-L102) [src/_pytest/pastebin.py#L105-L121](https://github.com/pytest-dev/pytest/blob/2887015cade4757385308e7a7d8083557fc637e2/src/_pytest/pastebin.py#L105-L121)
- Pytester.popen copies the parent environment, prepends the current directory to PYTHONPATH, and invokes subprocess.Popen; isolation changes must account for inherited state and child execution. — [src/_pytest/pytester.py#L1361-L1395](https://github.com/pytest-dev/pytest/blob/2887015cade4757385308e7a7d8083557fc637e2/src/_pytest/pytester.py#L1361-L1395)
- JUnit sessionfinish creates parent directories and opens the configured logfile in write mode; assertion-cache loading unmarshals code and executes it after header and source-hash checks. — [src/_pytest/junitxml.py#L668-L674](https://github.com/pytest-dev/pytest/blob/2887015cade4757385308e7a7d8083557fc637e2/src/_pytest/junitxml.py#L668-L674) [src/_pytest/assertion/rewrite.py#L364-L395](https://github.com/pytest-dev/pytest/blob/2887015cade4757385308e7a7d8083557fc637e2/src/_pytest/assertion/rewrite.py#L364-L395) [src/_pytest/assertion/rewrite.py#L175-L187](https://github.com/pytest-dev/pytest/blob/2887015cade4757385308e7a7d8083557fc637e2/src/_pytest/assertion/rewrite.py#L175-L187)
- Fixture-map changes already have a documented downstream compatibility impact: the BDD integration command is disabled, and fixture registration retains deprecated nodeid-based maps alongside preferred node-based registration. — [tox.ini#L190-L191](https://github.com/pytest-dev/pytest/blob/2887015cade4757385308e7a7d8083557fc637e2/tox.ini#L190-L191) [src/_pytest/fixtures.py#L2076-L2082](https://github.com/pytest-dev/pytest/blob/2887015cade4757385308e7a7d8083557fc637e2/src/_pytest/fixtures.py#L2076-L2082) [src/_pytest/fixtures.py#L2092-L2126](https://github.com/pytest-dev/pytest/blob/2887015cade4757385308e7a7d8083557fc637e2/src/_pytest/fixtures.py#L2092-L2126)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
