pytest 9.1.1
- Source
- https://github.com/pytest-dev/pytest
- Artifact scanned
pytest-9.1.1-py3-none-any.whl- Compared with
pytest-9.1.0-py3-none-any.whl(0 signals introduced since)- Files
- 83 scanned, 6 skipped (binary, oversized, or unrecognised)
- Signals
- 0 critical · 0 warn · 20 info
- Scan time
- 17.7 s
- LLM review
- Reviewed by claude-haiku-5-5 (Anthropic): 20 of 20 warn and critical signals; 20 demoted to info.
- Disclude version
- 4.3.0
- Scanned (UTC)
- 2026-10-23 00:09
Signals
Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.
-
returnlikely benign Evaluates an expression in a captured frame context for pytest's code-inspection repr.Reasoning
This eval runs a pytest expression against a frame's globals and locals, as used when rendering or repr-ing values in tracebacks. The expression comes from pytest's own code path, not from untrusted input, so this is a legitimate use of eval.
-
= = =likely benign Dynamically imports a hashlib-style module by name to compute a file hash.Reasoning
The module name comes from a fixed set of hash type names such as 'sha' or 'md5', chosen from a small internal list, and the result is used to compute a file checksum. This is an ordinary dynamic import of a standard hashing module.
-
=likely benign Imports the module corresponding to a Python file during pyimport.Reasoning
This is the pyimport helper, which imports a module by its computed dotted name from a package root so the file can be loaded as a module. Dynamic import by name is the expected mechanism here.
-
dellikely benign Reads a module's source file and executes it into the module namespace during pyimport.Reasoning
This is the py.path pyimport fallback that reads the module's source file and executes it into the module's namespace. Executing a module's own source is what importing a file means. The decoder-import signal fires on a pattern, not on any decoding or payload behaviour, and the file being read is the module under import.
-
dellikely benign Executes a module file's contents into its namespace during pyimport.Reasoning
This is the same exec of a module's own file contents into its __dict__ during pyimport. It is the normal behaviour of loading a Python file as a module.
-
likely benign Executes a cached rewritten code object into a test module during assertion-rewrite import.
Reasoning
This executes the cached rewritten code object into the module's dictionary, which is how pytest's assertion-rewriting import hook loads test modules. The bytecode is produced locally by pytest's own rewriter or read from its pyc cache, so the marshal/exec pattern is the expected import mechanism.
-
likely benign Runs the rewritten test module code object in the module namespace.
Reasoning
This is the same exec of the rewritten code object into the module namespace, the standard step of pytest's import hook. The code originates from pytest's own compilation of the test source.
-
= return ,likely benign Compiles the assertion-rewritten AST of a test module into a code object.Reasoning
This compiles an AST that pytest's assertion rewriter produced from the test source it is loading. Compiling a rewritten AST is the core of the rewrite hook.
-
=likely benign Loads a cached pytest rewrite .pyc via marshal to reuse compiled test bytecode.Reasoning
This reads a pytest-generated .pyc cache file via marshal.load, with error handling and a trace message. Reading a local bytecode cache is ordinary behaviour for the rewrite hook, and nothing here fetches or decodes an external payload.
-
# testing/test_config.py::test_disable_plugin_autoload. =likely benign Imports a pytest plugin module by its configured import spec.Reasoning
This imports a plugin module named by a configuration spec, such as an entry point or the -p option, and then looks it up in sys.modules. Dynamic plugin import is the expected pytest plugin-loading mechanism.
-
= = , ,likely benign Reads the caller's frame location to attach to a recorded pytest warning.Reasoning
This walks the caller's stack frame to record the file and line for a warning. Frame introspection with sys._getframe is routine for warning-location reporting.
-
"""Invoke debugging via ``Pdb.set_trace``, dropping any IO capturing.""" = . =likely benign Gets the caller's frame so pytest's pdb set_trace starts at the right location.Reasoning
This takes the caller's frame so the pdb debugger can start at the test location, which is the standard pytest breakpoint behaviour. It is interactive debugging support, not stealthy execution.
-
= = =likely benign Inspects the call stack to find the source location of a fixture definition.Reasoning
This uses inspect.stack to locate the source file and line of a fixture's definition for reporting and caching keys. It is a common, local introspection pattern in pytest's fixture machinery.
-
= =likely benign Compiles a parsed pytest -k/-m match expression into a code object.Reasoning
This compiles the AST of a -k or -m match expression that the user supplies on the command line, using a fixed filename. Compiling a parsed match expression is the intended behaviour.
-
""" return bool(eval(self._code, {"__builtins__": {}}, MatcherAdapter(matcher)))likely benign Evaluates a pytest mark-selection expression with restricted builtins.Reasoning
This is pytest's mark expression evaluator, which compiles a user-supplied -k/-m boolean expression and evaluates it with empty builtins and a restricted matcher adapter. It is a documented, intentional feature of pytest, not obfuscation or malicious intent.
-
= True # to catch syntaxerrors # Keep the public signature compatible while using the pytest 9.1 default behavior.likely benign Syntax-checks a module name via compile to surface SyntaxErrors in importorskip.Reasoning
compile(modname, '', 'eval') is a syntax-validation check on a module name string, a common pattern in pytest's importorskip to catch syntax errors. The result is discarded and nothing is executed.
-
# Since Python 3.13, f_locals is not a dict, but eval requires a dict. = , =likely benign Captures caller frame locals to evaluate check expressions in the pytester test helper.Reasoning
sys._getframe(1).f_locals is used to capture the caller's locals so that pytester's assert_outcomes-style checks can be evaluated as expressions. This is test-framework introspection, and the 'anti-analysis' label is a heuristic match on co-occurrence with eval/exit in a large test utility file, not evidence of evasion.
-
likely benign Evaluates test-authored check expressions against parsed call attributes in pytester.
Reasoning
eval(check, backlocals, call.__dict__) evaluates check expressions supplied by the test author within pytester's LineMatcher/ParsedCall checking helper. This is developer-facing test tooling operating on test-authored strings, not an attack path.
-
= f = =likely benign Compiles the skipif condition string from a pytest marker for evaluation.Reasoning
pytest's skipif marker compiles the user-provided condition string and evaluates it with the module's globals. This is the documented skipif(condition-string) feature and is expected behavior for a test framework.
-
= = =likely benign Evaluates the compiled skipif/xfail condition string within pytest's skipping logic.Reasoning
The eval of the compiled condition is the same documented string-condition feature of pytest skipif/xfail markers. The code is in a try block that handles SyntaxError to produce a readable error, consistent with legitimate framework code.
Reproduce This Scan
Run disclude locally to verify. These commands scan the published file; the "new in this release" marks come from comparing it with the previous release's file, which they don't repeat. Add --format sarif for SARIF output. Add --llm (with an API key in the environment) to include the LLM review.
|