PyPI / hypothesis / 6.170.3
hypothesis 6.170.3
- Source
- https://github.com/HypothesisWorks/hypothesis
- Tag scanned
v6.170.3- Directory
hypothesis- Compared with
v6.170.2(0 signals introduced since)- Files
- 537 scanned, 16 skipped (binary, oversized, or unrecognised)
- Signals
- 0 critical · 0 warn · 107 info
- Scan time
- 35.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-20 00:57
Signals
Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.
-
= = =likely benign Docs config executes the project's own version.py to read __version__.Reasoning
The exec reads the project's own src/hypothesis/version.py via a path joined from root and runs it into a dict to extract __version__. This is a known Sphinx conf pattern for single-sourcing the version; the file is repository source, not fetched or decoded payload. Module-scope exec on a non-literal is still worth noting, but context is benign.
-
-
# 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 -
) = =dismissed Uses frame introspection to report the call site of reject().Reasoning
inspect.currentframe is used to locate the caller for error messages about reject(). This is standard diagnostic code in a testing library.
-
= =dismissed Uses frame introspection to report the call site of assume().Reasoning
Same pattern as the reject() case: frame lookup to attribute assume() call location for reporting. Legitimate testing-library behavior.
-
=likely benign Decompresses the encoded reproduction blob in the library's own decoder.Reasoning
zlib.decompress on a value after a prefix byte is the documented decoding of Hypothesis's own reproduction blob format (failure database / @reproduce_failure). This is a parser for a data format, not a hidden payload being executed.
-
likely benign Validates generated repr text by compiling it as an expression.
Reasoning
compile(repr(...)) is a syntax check on a generated string to decide whether a default value can be emitted as source. It compiles but does not execute the result, and the input is a repr of library objects.
-
= # Finally, try to work out the imports we need for builds(), .map(), # .filter(), and .flatmap() to work without NameErrorlikely benign Syntax-checks a generated expression string via compile.Reasoning
Compiles a generated source string purely to check syntax before emitting it; no execution of the result. Consistent with ghostwriter's code generation.
-
# executed; so you still shouldn't ghostwrite for hostile code. =likely benign Syntax-checks a repr string to choose a fallback representation.Reasoning
compile(repr(identity), ..., 'exec') is a syntax check on a repr string used to decide whether to fall back to repr; the comment acknowledges ghostwriting does not execute hostile code. 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:dismissed Walks stack frames to compute a size value internally.Reasoning
sys._getframe(2) walks the stack to estimate a size for a depth-based helper. Internal introspection with no network or payload behavior.
-
# 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. = = = fdismissed Reads caller frame file and line for coverage descriptions.Reasoning
Reads the caller's filename and line number to describe coverage-tracked locations. Standard coverage-support logic.
-
info
warn→ info by reviewdynamic-executionhypothesis/src/hypothesis/internal/lambda_sources.py:265:20=likely benign Evaluates reconstructed lambda source to rebuild a function object.Reasoning
eval of source reconstructed from the lambda's own code object to rebuild the function for shrinking/reporting. This is a known technique for recovering lambda objects in a testing library; the source originates from the program under test, not an external attacker payload.
-
info
warn→ info by reviewdynamic-executionhypothesis/src/hypothesis/internal/lambda_sources.py:298:9) =likely benign Executes generated source to reconstruct a lambda with closure variables.Reasoning
exec of a generated construction string that defines __construct_lambda in f_globals, used to rebuild lambdas with closures. Dynamic code generation is inherent to this module's purpose; no evidence of hidden or fetched code.
-
assert = returnlikely benign Execs source into a module dict to materialize functions, with caching.Reasoning
exec of source text into a result module dict with an eval cache, used to recreate functions from source strings. It is a general-purpose reflection helper; the input is the library's own source for functions under test, so this is a legitimate, if powerful, pattern.
-
info
warn→ info by reviewframe-introspectionhypothesis/src/hypothesis/internal/scrutineer.py:114:13# pragma: no cover # only on Python < 3.12 returndismissed Installs a trace function for code-path analysis.Reasoning
sys.settrace installs a tracer to collect coverage-like information for distinguishing behavior, guarded for Python versions without sys.monitoring. Standard tracing for a testing tool.
-
info
warn→ info by reviewframe-introspectionhypothesis/src/hypothesis/internal/scrutineer.py:137:13# pragma: no cover # only on Python < 3.12 returndismissed Clears the trace function on exit.Reasoning
Removes the trace function set in the paired __enter__, a normal teardown for the tracer above. Benign.
-
info
warn→ info by reviewframe-introspectionhypothesis/src/hypothesis/strategies/_internal/strategies.py:102:31return : | None = =likely benign Walks the call stack to locate the user's frame for reporting strategy definition locations.Reasoning
sys._getframe(1) walks up the stack past Hypothesis's own files to find the user's calling location for error messages. Standard library 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 Inspects the call stack to find a source location for type-resolution diagnostics.Reasoning
Same pattern: sys._getframe() is used to find a user-code location for diagnostics when resolving types. Legitimate library introspection.
-
info
critical→ info by reviewdynamic-executionhypothesis/tests/codemods/test_codemod_cli.py:40:12returnlikely benign Test helper that runs a caller-supplied command string through a shell for CLI tests.Reasoning
This is a small test helper that forwards a command 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 Test asserting stack depth via inspect.stack in a recursive function.Reasoning
inspect.stack(0) is used in a test to check stack depth in a recursive helper. Pure introspection in a test, no malicious behavior.
-
assert not = assert assert notlikely benign Round-trips a FeatureFlags object through repr and eval to check its representation.Reasoning
eval(repr(flags)) is a round-trip serialization check on a feature-flags object the test itself constructed. The input is trusted, locally generated repr output.
-
=likely benign Round-trips feature flags via repr and eval in a test.Reasoning
Same round-trip pattern on test-generated feature flags, eval of its own repr output. Benign test code.
-
# the line `offset` lines below the `def` statement of the calling function = . return flikely benign Computes the caller's source line from its frame in an observability test.Reasoning
inspect.currentframe().f_back is used to compute the line number of the calling test function for an assertion about observability output. Benign introspection.
-
]: = assert == assert ==likely benign Evals pretty-printed regex pattern output to verify round-tripping.Reasoning
eval of pretty.pretty output for a regex object in a round-trip test, with the input built by the test. Trusted, benign.
-
assert ==likely benign Evals a repr string in a restricted namespace to test float round-tripping.Reasoning
Evals a repr string of a test-supplied object with a restricted namespace to check float lexical round-trip. Benign test code.
-
assert ==likely benign Evals a parametrized enum representation to verify pretty-printing.Reasoning
Parametrized test evaluates pretty-printing inputs of enum representations to check round-trip. Inputs are fixed test data.
-
assert == f # hexadecimal with underscores assert ==likely benign Evals a formatted hex literal to confirm its value in a test.Reasoning
eval(got) checks a formatted hexadecimal-with-underscores literal produced by the test. Trusted test input.
-
info
warn→ info by reviewdecoder-import-with-exechypothesis/tests/cover/test_reproduce_failure.py:146:20= = =likely benign Evaluates a reproduce_failure decorator string extracted from failure notes to reapply a seed.Reasoning
The pattern of base64 and zlib imports plus eval would look like a staged payload, but here the eval'd string is a reproduce_failure decorator expression extracted from Hypothesis's own failure notes and returns a test-wrapping callable. This is the documented reproduction feature, not a dropper; the snippet shows no network or exec of fetched content.
-
info
warn→ info by reviewdynamic-executionhypothesis/tests/cover/test_reproduce_failure.py:146:20= = =likely benign Evals the extracted reproduce_failure decorator string from notes.Reasoning
Same eval of the extracted reproduce_failure decorator string. This is the library's own reproduction mechanism operating on its generated output, benign on the evidence shown.
-
-
-
= = -
= = -
= = -
= = -
= = -
= = -
= = -
= = -
info
warn→ info by reviewunicode-mixed-scripthypothesis/tests/cover/test_unicode_identifiers.py:37:1= == 3.1415likely benign Defines a lambda with a Greek letter in its name to test Unicode identifier support.Reasoning
A deliberate Unicode identifier test using a Greek π in a Latin-named lambda. Mixed-script identifiers are intentional here to test Unicode handling, and the raw pass has a higher false-positive rate.
-
info
warn→ info by reviewunicode-mixed-scripthypothesis/tests/cover/test_unicode_identifiers.py:41:44assert ==likely benign Test using a mixed-script Unicode identifier in a lambda description check.Reasoning
Uses the intentional mixed-script identifier from the same Unicode test to verify description output. Benign test of identifier handling.
-
info
warn→ info by reviewdynamic-executionhypothesis/tests/ghostwriter/recorded/magic_builtins.txt:112:5eval(source, globals, locals)dismissed Prose or recorded fixture showing an eval example in a Ghostwriter test file.Reasoning
This is a recorded text fixture (markup prose) containing eval in an example snippet, not executable code. The file type makes the eval a non-issue.
-
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 helper executing ghostwriter-generated source to verify it runs without errors.Reasoning
This is a Hypothesis ghostwriter test that execs generated source code to check it is valid. The base64 import is incidental to the module's purpose, and exec of test-generated source is expected in this test context.
-
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 of expected generated source in a test assertion.Reasoning
exec is applied to the expected source string in a test asserting the generated code is syntactically and name-valid. This is a deliberate test-time check on known test fixtures, not a payload dropper.
-
info
warn→ info by reviewdynamic-executionhypothesis/tests/ghostwriter/test_expected_output.py:317:5assert ==likely benign Test exec of expected ghostwriter output with a namespace dict.Reasoning
Same pattern: exec of expected generated code with a controlled namespace inside a test verifying ghostwriter output.
-
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 for validity checking.Reasoning
Repeated test pattern executing expected generated source to confirm it is valid Python. Consistent with a test suite for a code generator.
-
likely benign Test helper executing generated source with a namespace and debug print on exception.
Reasoning
Inside a helper that execs generated source and prints it on failure; a standard pattern for testing code generation in the Hypothesis ghostwriter tests.
-
=likely benign Test exec of ghostwriter-generated source.Reasoning
Executes output of ghostwriter.magic in a test to verify it runs. The source is produced by the library under test, not untrusted input.
-
=likely benign Test exec of generated binary operation test source.Reasoning
Executes ghostwriter.binary_operation output in a test; the source is generated by the library from known inputs.
-
# Most importantly: the code should execute without NameErrorlikely benign Test exec of generated source checking for NameError absence.Reasoning
Test asserting generated code runs without NameError; exec is used on library-generated code in a test.
-
= # and also works with explicit identity element =likely benign Test exec of binary operation generated source.Reasoning
Test execution of ghostwriter.binary_operation output, including an identity variant; benign test verification.
-
=likely benign Test exec of binary operation source with explicit identity.Reasoning
Same benign test pattern executing generated binary operation source.
-
assert inlikely benign Test exec of generated source containing one_of.Reasoning
Test exec of ghostwriter-generated source checking for one_of strategy text; benign.
-
= # Also cover passing an explicit `annotate`, rather than the default None. =likely benign Test exec of generated ufunc test source.Reasoning
Test exec of ghostwriter.ufunc output for numpy.isnan; benign verification of generated code.
-
=likely benign Test exec of annotated ufunc generated source.Reasoning
Test exec of ufunc generated source with annotate=True; benign test code.
-
info
critical→ info by reviewdynamic-executionhypothesis/tests/ghostwriter/test_ghostwriter_cli.py:43:12returnlikely benign Test helper running a command via subprocess with shell=True.Reasoning
A small test-helper wrapper around subprocess.run with shell=True. The command is passed by test code, not from untrusted input; shell=True is a code smell but not malicious in a test utility.
-
= = = assert ==likely benign Test eval of strategy repr for round-trip checking.Reasoning
Round-trip test evaluating repr output of strategies to check repr stability; the input is repr of library objects in a test.
-
assert ==likely benign Test eval of sampled strategy reprs for round-trip assertion.Reasoning
Parametrized test evaluating sampled transform reprs to confirm they round-trip; benign test logic.
-
= = =likely benign A pytest test uses eval on a parameter to construct a numpy array for testing floor and ceil behavior.Reasoning
The eval call takes a parameter named value, which in a test function is likely a parametrized literal string such as a list expression (e.g., '[1.5, -2.3]') used to build a numpy array for comparing floor and ceil behavior. This is a common pattern in test suites and is not an obfuscated payload. Residual doubt: the snippet does not show the parametrize source, so eval of an externally supplied string cannot be fully ruled out, but within a test file it is most plausibly benign.
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.
&&