PyPI / hypothesis / 6.169.3
hypothesis 6.169.3
- Source
- https://github.com/HypothesisWorks/hypothesis
- Tag scanned
v6.169.3- Directory
hypothesis- Compared with
v6.169.2(0 signals introduced since)- Files
- 536 scanned, 16 skipped (binary, oversized, or unrecognised)
- Signals
- 0 critical · 0 warn · 107 info
- Scan time
- 32.5 s
- LLM review
- Reviewed by claude-haiku-5-5 (Anthropic): 47 of 47 warn and critical signals; 47 demoted to info.
- Disclude version
- 4.0.0
- Scanned (UTC)
- 2026-10-15 13:41
Signals
Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.
-
= = =likely benign Docs config execs the project's own version.py to read __version__.Reasoning
exec of file contents read from the repo's own src/hypothesis/version.py in the Sphinx docs config. It is a known idiom for reading __version__ without importing the package. Not malicious, though exec at module scope is a poor practice.
-
-
# Run all the no-extra-dependency tests for this version (except slow nocover tests) # Run tests for each extra module while the requirements are installed -
-
-
-
-
-
-
-
-
# Run some tests without docstrings or assertions, to catch bugs -
# like issue #822 in one of the test decorators. See also #1541. PYTHONOPTIMIZE=2 -
-
-
-
# like issue #822 in one of the test decorators. See also #1541. PYTHONOPTIMIZE=2 -
-
-
-
-
-
if [; then -
-
-
-
if [ ; then -
-
-
# ...but running twice takes time, don't overdo it -
# ...but running twice takes time, don't overdo it else -
else fi -
) = =likely benign Uses frame introspection to report where reject() was called.Reasoning
inspect.currentframe used to locate the caller of reject() for error/observability reporting. Standard testing library behaviour.
-
= =likely benign Uses frame introspection to record the caller location in assume().Reasoning
Same pattern as assume(): frame lookup to record the calling location for observability. Legitimate.
-
=likely benign Decompresses a base64/zlib-encoded value, likely a stored example or seed.Reasoning
zlib decompression of a versioned, base64-encoded blob that is the Hypothesis database/seed encoding, with error handling. The payload is data the library itself produces, not a hidden dropper.
-
likely benign Uses compile() to check that a repr string is valid Python syntax.
Reasoning
compile is used as a syntax validity check on repr() output of a strategy, inside a suppress(SyntaxError) block. It is not executing untrusted input in a meaningful way.
-
= # Finally, try to work out the imports we need for builds(), .map(), # .filter(), and .flatmap() to work without NameErrorlikely benign Compiles generated source text to validate its syntax.Reasoning
compile of generated source text for syntax validation only, not executed. Benign code-generation check.
-
# executed; so you still shouldn't ghostwrite for hostile code. =likely benign Checks whether a repr is valid Python with compile() and falls back on SyntaxError.Reasoning
compile(repr(identity)) with SyntaxError fallback, used to check whether a repr is valid code. The comment itself notes that ghostwriting for hostile code is unsafe, meaning it is not designed to run untrusted input. Benign.
-
# The sum of a geometric series is given by (ref: wikipedia): # ᵐ∑ₖ₌₀ aᵏ = (aᵐ⁺¹ - 1) / (a - 1) # = S(m) / S(0) # assuming a != 1 and using the definition -
# The sum of a geometric series is given by (ref: wikipedia): # ᵐ∑ₖ₌₀ aᵏ = (aᵐ⁺¹ - 1) / (a - 1) # = S(m) / S(0) # assuming a != 1 and using the definition -
# assuming a != 1 and using the definition # S(m) := aᵐ⁺¹ - 1. # The sum we want, starting from a number n [0 <= n <= m] rather than zero, is # ᵐ∑ₖ₌ₙ aᵏ = ᵐ∑ₖ₌₀ aᵏ - ⁿ⁻¹∑ₖ₌₀ aᵏ = S(m) / S(0) - S(n - 1) / S(0) -
# The sum we want, starting from a number n [0 <= n <= m] rather than zero, is # ᵐ∑ₖ₌ₙ aᵏ = ᵐ∑ₖ₌₀ aᵏ - ⁿ⁻¹∑ₖ₌₀ aᵏ = S(m) / S(0) - S(n - 1) / S(0) return ** - 1 -
# The sum we want, starting from a number n [0 <= n <= m] rather than zero, is # ᵐ∑ₖ₌ₙ aᵏ = ᵐ∑ₖ₌₀ aᵏ - ⁿ⁻¹∑ₖ₌₀ aᵏ = S(m) / S(0) - S(n - 1) / S(0) return ** - 1 -
# The sum we want, starting from a number n [0 <= n <= m] rather than zero, is # ᵐ∑ₖ₌ₙ aᵏ = ᵐ∑ₖ₌₀ aᵏ - ⁿ⁻¹∑ₖ₌₀ aᵏ = S(m) / S(0) - S(n - 1) / S(0) return ** - 1 -
info
warn→ info by reviewframe-introspectionhypothesis/src/hypothesis/internal/conjecture/junkdrawer.py:316:13""" frame = sys._getframe(2) size = 1 while frame:likely benign Walks call frames via sys._getframe for a size estimate.Reasoning
sys._getframe used to walk the call stack for a size heuristic in a testing utility. Standard and benign.
-
# common unicode characters , # characters which increase in length when lowercased -
# common unicode characters , # characters which increase in length when lowercased -
# common unicode characters , # characters which increase in length when lowercased -
# ligatures , # emoticons , -
# upsidown text , # reserved strings in windows , -
# upsidown text , # reserved strings in windows , -
# upsidown text , # reserved strings in windows , -
# upsidown text , # reserved strings in windows , -
# upsidown text , # reserved strings in windows , -
�̲e͇̣̰̦̬͎ ̢̼̻̱̘h͚͎͙̜̣̲ͅi̦̲̣̰̤v̻͍e̺̭̳̪̰-m̢iͅn̖̺̞̲̯̰d̵̼̟͙̩̼̘̳ ̞̥̱̳̭r̛̗̘e͙p͠r̼̞̻̭̗e̺̠̣͟s̘͇̳͍̝͉e͉̥̯̞̲͚̬͜ǹ̬͎͎̟̖͇̤t͍̬̤͓̼̭͘ͅi̪̱n͠g̴͉ ⟨U+034F⟩͉ͅc̬̟h͡a̫̻̯͘o̫̟̖͍̙̝͉s̗̦̲.̨̹͈̣ -
�̜̣̲ͅi̦̲̣̰̤v̻͍e̺̭̳̪̰-m̢iͅn̖̺̞̲̯̰d̵̼̟͙̩̼̘̳ ̞̥̱̳̭r̛̗̘e͙p͠r̼̞̻̭̗e̺̠̣͟s̘͇̳͍̝͉e͉̥̯̞̲͚̬͜ǹ̬͎͎̟̖͇̤t͍̬̤͓̼̭͘ͅi̪̱n͠g̴͉ ⟨U+034F⟩͉ͅc̬̟h͡a̫̻̯͘o̫̟̖͍̙̝͉s̗̦̲.̨̹͈̣ -
�̲͚̬͜ǹ̬͎͎̟̖͇̤t͍̬̤͓̼̭͘ͅi̪̱n͠g̴͉ ⟨U+034F⟩͉ͅc̬̟h͡a̫̻̯͘o̫̟̖͍̙̝͉s̗̦̲.̨̹͈̣ -
�͇̤t͍̬̤͓̼̭͘ͅi̪̱n͠g̴͉ ⟨U+034F⟩͉ͅc̬̟h͡a̫̻̯͘o̫̟̖͍̙̝͉s̗̦̲.̨̹͈̣ -
# stack frames up. = = = flikely benign Uses sys._getframe to describe the caller location for coverage.Reasoning
sys._getframe used to find the caller's filename and line for coverage description. Standard library-internal introspection.
-
info
warn→ info by reviewdynamic-executionhypothesis/src/hypothesis/internal/lambda_sources.py:265:20=likely benign Evals reconstructed lambda source to rebuild a function object.Reasoning
eval of source text recovered from a lambda's code object, used to reconstruct lambda objects for repr and reflection. Inputs are the library's own lambda source, not external untrusted data. A reasonable pattern for this purpose.
-
info
warn→ info by reviewdynamic-executionhypothesis/src/hypothesis/internal/lambda_sources.py:298:9) =likely benign Execs generated code to construct a lambda from recovered source.Reasoning
exec builds a generated __construct_lambda helper from reconstructed source. It is internal reflection machinery, not attacker-controlled input. Benign in context, though dynamic.
-
assert = returnlikely benign Execs source text into a module namespace to build a function, with caching.Reasoning
exec of source into a fresh module dict for dynamic function construction in a reflection helper, with a cache. Dynamic code generation, but the source originates from the library's own code paths.
-
info
warn→ info by reviewframe-introspectionhypothesis/src/hypothesis/internal/scrutineer.py:114:13# pragma: no cover # only on Python < 3.12 returnlikely benign Installs a trace function for Python <3.12 to record behaviour.Reasoning
sys.settrace used by the coverage/scrutineer tracer on Python versions without sys.monitoring, with pragma comments. Legitimate tooling.
-
info
warn→ info by reviewframe-introspectionhypothesis/src/hypothesis/internal/scrutineer.py:137:13# pragma: no cover # only on Python < 3.12 returnlikely benign Removes the trace function after tracing completes.Reasoning
Clears the trace function set above, the matching teardown. Legitimate.
-
info
warn→ info by reviewframe-introspectionhypothesis/src/hypothesis/strategies/_internal/strategies.py:102:31return : | None = =likely benign Hypothesis walks the call stack to locate the user's code that created a strategy.Reasoning
sys._getframe(1) walks up the stack to find the first frame outside Hypothesis's own files, which is a standard way to report where a strategy was defined. Read-only introspection with no network, file, or execution side effects.
-
info
warn→ info by reviewframe-introspectionhypothesis/src/hypothesis/strategies/_internal/types.py:227:37: | None = None : | None = = flikely benign Hypothesis inspects the call stack to find a source location for type-resolution reporting.Reasoning
sys._getframe() is used to search the stack for a source location, matching the library's own diagnostic and reporting purpose. It only reads frame metadata.
-
info
critical→ info by reviewdynamic-executionhypothesis/tests/codemods/test_codemod_cli.py:40:12returnlikely benign A test helper runs a caller-provided command through the shell to exercise the codemod CLI.Reasoning
This is a test helper that forwards a caller-supplied command string to subprocess.run with shell=True. The command comes from test code, not untrusted input, so the risk is limited to the test harness. Still, shell=True with a non-literal command is a pattern worth a glance.
-
info
warn→ info by reviewframe-introspectionhypothesis/tests/conjecture/test_junkdrawer.py:201:16assert ==likely benign A test uses inspect.stack to verify stack depth during recursion.Reasoning
inspect.stack(0) is used in a test to check stack depth in a recursive function. It is a purely introspective test of the library's own utilities.
-
assert not = assert assert notlikely benign A test evals a repr of a feature-flags object to check round-tripping.Reasoning
eval(repr(flags)) is a round-trip test confirming that the feature-flags object's repr can be reconstructed. The eval input is the library's own repr output, not external data.
-
=likely benign A test evals the repr of feature flags to verify reconstruction.Reasoning
Same repr round-trip pattern as the earlier eval in this file, operating on the library's own serialized output in a test.
-
# the line `offset` lines below the `def` statement of the calling function = . return flikely benign A test uses the current frame to compute an expected file and line location.Reasoning
inspect.currentframe().f_back is used to compute the expected source line of a calling function for an observability test. It is read-only test scaffolding.
-
]: = assert == assert ==likely benign A test evals pretty-printed regex output to verify round-tripping.Reasoning
eval of pretty-printed output in a test checks that the pretty printer produces code that reconstructs the same regex object. The input is generated by the library under test.
-
assert ==likely benign A test evals a float representation in a restricted namespace to check reconstruction.Reasoning
eval of a repr string in a test, with a restricted namespace, checks that a float representation reconstructs correctly. This is standard round-trip testing.
-
assert ==likely benign A test evals a parametrized representation to verify pretty-printed enum code.Reasoning
eval(rep) on a parametrized representation of enum-like output checks that the pretty printer emits valid code. The input is from the test's own parameters.
-
assert == f # hexadecimal with underscores assert ==likely benign A test evals formatted hex output to verify it reconstructs the original integer.Reasoning
eval of formatted hexadecimal output with underscores checks that the pretty printer's output reconstructs the original value. This is a round-trip assertion in a test.
-
info
warn→ info by reviewdecoder-import-with-exechypothesis/tests/cover/test_reproduce_failure.py:146:20= = =likely benign A test decodes a reproduce_failure blob from notes and evals it to replay a failure.Reasoning
The file imports base64 and zlib, and eval is applied to a regex match extracted from the notes. This is the reproduce_failure decorator's documented decode-and-reconstruct path, which Hypothesis uses to replay failures. The shape resembles a multi-stage payload, but the code is test scaffolding over the library's own blob format.
-
info
warn→ info by reviewdynamic-executionhypothesis/tests/cover/test_reproduce_failure.py:146:20= = =likely benign A test evals an extracted reproduction string to replay a recorded failure.Reasoning
The same eval of the extracted reproduction expression as the paired decoder finding. It is the library's own failure-replay mechanism exercised in tests.
-
-
-
= = -
= = -
= = -
= = -
= = -
= = -
= = -
= = -
info
warn→ info by reviewunicode-mixed-scripthypothesis/tests/cover/test_unicode_identifiers.py:37:1= == 3.1415likely benign A lambda named with a Greek letter tests unicode identifier handling.Reasoning
The file is named test_unicode_identifiers and the identifier is deliberately mixed Latin and Greek, to test that Hypothesis handles unicode identifiers. This is an intentional test case, not obfuscation.
-
info
warn→ info by reviewunicode-mixed-scripthypothesis/tests/cover/test_unicode_identifiers.py:41:44assert ==likely benign A test uses the Greek-named lambda to check unicode identifier descriptions.Reasoning
Same deliberate mixed-script identifier as the definition, used in a test asserting the pretty-printed description. The unicode case is the point of the test.
-
info
warn→ info by reviewdynamic-executionhypothesis/tests/ghostwriter/recorded/magic_builtins.txt:112:5eval(source, globals, locals)dismissed A recorded documentation snippet shows eval being called on a string literal.Reasoning
This is an eval call inside recorded prose or documentation output in a text file, not executable code. It is not a live execution path.
-
info
warn→ info by reviewdecoder-import-with-exechypothesis/tests/ghostwriter/test_expected_output.py:302:5assert == # We got the expected source code # and there are no SyntaxError or NameErrorslikely benign Test asserts generated source code executes without errors via exec.Reasoning
This is a Hypothesis test suite for the ghostwriter feature. exec is used to verify that generated source code is valid Python, which is a standard testing pattern. The base64 import co-occurrence is incidental and not a decoder chain.
-
info
warn→ info by reviewdynamic-executionhypothesis/tests/ghostwriter/test_expected_output.py:302:5assert == # We got the expected source code # and there are no SyntaxError or NameErrorslikely benign exec runs test-expected generated source to check it is valid.Reasoning
exec on expected generated code in a test file checks syntax and name validity; the input is a test fixture, not attacker-controlled data.
-
info
warn→ info by reviewdynamic-executionhypothesis/tests/ghostwriter/test_expected_output.py:317:5assert ==likely benign Test exec of expected generated source code.Reasoning
Same testing pattern: exec of generated expected source in a namespace to verify it runs. No external input involved.
-
info
warn→ info by reviewdynamic-executionhypothesis/tests/ghostwriter/test_expected_output.py:339:5assert == # We got the expected source code # and there are no SyntaxError or NameErrorslikely benign Test exec of expected generated source code.Reasoning
Repeated test-verification exec of expected generated source; benign test harness code.
-
likely benign Test helper executes generated source code and logs on exception.
Reasoning
Within a helper that execs generated source for validation and prints it on failure; a test utility rather than malicious execution.
-
=likely benign Test execs ghostwriter-generated magic source.Reasoning
Test verifies ghostwriter-generated source runs; the source is produced by the library under test.
-
=likely benign Test execs generated binary operation source.Reasoning
Test execs library-generated binary_operation source to confirm validity.
-
# Most importantly: the code should execute without NameErrorlikely benign Test execs generated source to check for NameError.Reasoning
Test confirms generated code executes without NameError; standard test pattern.
-
= # and also works with explicit identity element =likely benign Test execs generated binary operation source.Reasoning
Test execs library-generated source for binary_operation; benign verification.
-
=likely benign Test execs generated binary operation source with identity.Reasoning
Same benign test verification of generated source with identity argument.
-
assert inlikely benign Test execs generated source code.Reasoning
Test execs ghostwriter-generated source containing one_of; benign.
-
= # Also cover passing an explicit `annotate`, rather than the default None. =likely benign Test execs generated ufunc source.Reasoning
Test execs ghostwriter.ufunc output for numpy.isnan; benign verification.
-
=likely benign Test execs generated ufunc source with annotate.Reasoning
Test execs generated ufunc source with annotate; benign verification.
-
info
critical→ info by reviewdynamic-executionhypothesis/tests/ghostwriter/test_ghostwriter_cli.py:43:12returnlikely benign Test helper running CLI commands through a shell.Reasoning
A small test-harness wrapper around subprocess.run with shell=True for CLI tests. Critical severity is overstated because cmd is a caller-supplied test string, not untrusted input, though shell=True is a poor practice worth noting.
-
= = = assert ==likely benign Test evals strategy repr to check round-trip stability.Reasoning
Round-trip test evaluating repr of Hypothesis strategies in a controlled globals dict to check repr stability; the input is strategy repr generated in-process.
-
assert ==likely benign Test evals strategy repr strings for round-trip checks.Reasoning
Parametrized test evaluating repr strings of strategies in a fixed namespace; benign test code.
-
= = =likely benign A numpy test helper calls eval on a function parameter to construct an array for floor/ceil comparisons.Reasoning
The eval is applied to a parameter named value in a pytest-style test function, plausibly fed with parametrized literal strings like '[1.5, -2.3]' to build numpy arrays. This is a common though poor practice in test code. It is not obfuscation or a dropper: no encoding, no network or shell activity, and the result is only used to compute floor and ceil for assertions. The risk is limited to whatever inputs the test is parametrized with, and the snippet does not show the parametrization. Hence likely benign with a small residual doubt.
Reproduce This Scan
Run disclude locally to verify. Add --format sarif for SARIF output. Add --llm (with an API key in the environment) to include the LLM review.
&&