PyPI / hypothesis / 6.170.1
hypothesis 6.170.1
- Source
- https://github.com/HypothesisWorks/hypothesis
- Tag scanned
v6.170.1- Directory
hypothesis- Compared with
v6.170.0(0 signals introduced since)- Files
- 537 scanned, 16 skipped (binary, oversized, or unrecognised)
- Signals
- 0 critical · 0 warn · 107 info
- Scan time
- 31.7 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-16 17:44
Signals
Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.
-
= = =likely benign Docs config execs the package's own version.py to read __version__.Reasoning
exec of a version.py file read from the project's own source tree during docs build; the expression is a path join with a literal, a known Sphinx-docs idiom for reading __version__ without importing the package. Not obfuscation, though exec on a file 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 Captures the caller frame to report where reject() was invoked.Reasoning
inspect.currentframe used to locate the caller for error messages in reject(); standard testing-library introspection.
-
= =likely benign Captures the caller frame for assume() location reporting.Reasoning
Same caller-location introspection for assume(), used for observability reporting.
-
=likely benign Decompresses the serialized blob used to replay failing test examples.Reasoning
zlib.decompress on a value from the Hypothesis reproduce-blob encoding (version byte stripped, then decoded); this is the library's own serialization format for replaying failing examples, not a hidden payload.
-
likely benign Syntax-checks repr of a parameter default before using it in generated code.
Reasoning
compile of repr() of a strategy used only as a syntax check to decide whether to insert a default value; it is a validation step on the library's own generated text.
-
= # Finally, try to work out the imports we need for builds(), .map(), # .filter(), and .flatmap() to work without NameErrorlikely benign Compiles generated expression text purely to validate its syntax.Reasoning
compile used to validate generated source text for ghostwritten tests; a syntax check with no execution.
-
# executed; so you still shouldn't ghostwrite for hostile code. =likely benign Syntax-checks a repr string to decide how to emit an identity in generated code.Reasoning
compile(repr(identity)) is a syntax-validity probe; the comment indicates intent, and the result only decides whether to fall back to repr.
-
# 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 the call stack to estimate object size for internal bookkeeping.Reasoning
sys._getframe used to walk the stack for size estimation in a testing utility; ordinary introspection.
-
# 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 Reads caller frame metadata to label coverage observations.Reasoning
sys._getframe used to find the caller's filename and line for coverage-description labels; standard debug/introspection use.
-
info
warn→ info by reviewdynamic-executionhypothesis/src/hypothesis/internal/lambda_sources.py:265:20=likely benign Evaluates reconstructed lambda source to rebuild a function for display or reuse.Reasoning
eval of reconstructed lambda source from the library's own source-extraction logic, for recreating lambdas in repr output; the source comes from the user's own code being tested, not an external payload.
-
info
warn→ info by reviewdynamic-executionhypothesis/src/hypothesis/internal/lambda_sources.py:298:9) =likely benign Execs generated code to reconstruct a lambda that has free variables.Reasoning
exec of a generated construction string for lambdas with closures, reconstructing function objects from their extracted source; a known metaprogramming pattern in this module, operating on local code.
-
assert = returnlikely benign Executes reconstructed function source into a fresh namespace with caching.Reasoning
exec of source text into a result module dict, used to reconstruct functions from source for caching; this is the library's dynamic-function-building utility, with the source derived from the user's own code.
-
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 code-behavior analysis on older Pythons.Reasoning
sys.settrace installs a tracer for coverage/scrutiny analysis, guarded for Python versions without sys.monitoring; a legitimate profiling mechanism.
-
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 installed by the scrutineer.Reasoning
Paired removal of the trace function set above; normal cleanup.
-
info
warn→ info by reviewframe-introspectionhypothesis/src/hypothesis/strategies/_internal/strategies.py:102:31return : | None = =likely benign Stack walk to find the user-code location of a strategy definition.Reasoning
sys._getframe(1) walks up the stack past Hypothesis's own files to report the user's call site for strategy location. This is a standard debugging/location technique in a testing library, not evasion.
-
info
warn→ info by reviewframe-introspectionhypothesis/src/hypothesis/strategies/_internal/types.py:227:37: | None = None : | None = = flikely benign Frame walk to locate the calling user code for error or repr reporting.Reasoning
sys._getframe() walks frames to find the first non-Hypothesis location, used for reporting where a type-resolved strategy was created. Legitimate library introspection.
-
info
critical→ info by reviewdynamic-executionhypothesis/tests/codemods/test_codemod_cli.py:40:12returnlikely benign Test helper that shells out to run the codemod CLI.Reasoning
A test helper runs a command via shell=True, but the caller is a test utility for invoking the codemod CLI with test-supplied arguments. The pattern is risky in general, but here it is confined to test code with no attacker-controlled input path shown.
-
info
warn→ info by reviewframe-introspectionhypothesis/tests/conjecture/test_junkdrawer.py:201:16assert ==likely benign Test asserting stack-depth helper behavior via recursion.Reasoning
inspect.stack(0) is used in a test to check that stack depth matches the caller's depth. Purely a test of the junkdrawer utility.
-
assert not = assert assert notlikely benign Round-trip test evaluating the repr of a feature-flags object.Reasoning
eval(repr(flags)) is a round-trip test confirming the repr of a FeatureFlags object reconstructs an equivalent object. The eval input is the library's own repr output, not external data.
-
=likely benign Round-trip eval of feature-flags repr in a test.Reasoning
Same repr round-trip pattern as the earlier feature-flags test, evaluating the library's own repr output in a test.
-
# the line `offset` lines below the `def` statement of the calling function = . return flikely benign Test helper computing a caller's file and line for assertions.Reasoning
inspect.currentframe().f_back is used to compute the line number of a calling function for test expectations. Ordinary test helper behavior.
-
]: = assert == assert ==likely benign Round-trip test evaluating pretty-printed regex output.Reasoning
eval of pretty.pretty(r) checks that a regex pretty-printed representation reconstructs the same object. Self-generated input in a test.
-
assert ==likely benign Test evaluating a generated repr string for float round-trip checks.Reasoning
Evaluates a repr string with a restricted namespace to check float lexing for NaN and struct values. Test-generated input in a controlled namespace.
-
assert ==likely benign Test evaluating enum repr strings from parametrized fixtures.Reasoning
Evaluates a parametrized repr string of an enum and checks it pretty-prints back to the same text. Test fixture input only.
-
assert == f # hexadecimal with underscores assert ==likely benign Test evaluating a formatted integer literal to verify it round-trips.Reasoning
eval(got) checks that a formatted hexadecimal-with-underscores string parses back to the original integer. Self-generated test value.
-
info
warn→ info by reviewdecoder-import-with-exechypothesis/tests/cover/test_reproduce_failure.py:146:20= = =likely benign Decodes and evals a reproduction blob for the reproduce_failure feature.Reasoning
The file imports base64 and zlib and evals decoded text. This matches the multi-stage shape, but it is the library's own reproduce_failure decorator decoding a blob from the user's notes and reconstructing a test. Legitimate, documented feature under test.
-
info
warn→ info by reviewdynamic-executionhypothesis/tests/cover/test_reproduce_failure.py:146:20= = =likely benign Eval of the decoded reproduction blob in reproduce_failure handling.Reasoning
Same eval call as the decoder-import finding, flagged separately as a dynamic-execution signal. Same legitimate reproduce_failure mechanism applies.
-
-
-
= = -
= = -
= = -
= = -
= = -
= = -
= = -
= = -
info
warn→ info by reviewunicode-mixed-scripthypothesis/tests/cover/test_unicode_identifiers.py:37:1= == 3.1415dismissed Lambda named with a Greek pi, testing unicode identifier support.Reasoning
The Greek letter pi in an identifier is deliberate, as the test file is named for unicode identifiers. Mixed-script identifiers in a test are expected and not a deceptive homoglyph attack.
-
info
warn→ info by reviewunicode-mixed-scripthypothesis/tests/cover/test_unicode_identifiers.py:41:44assert ==dismissed Test referencing the unicode-named lambda for description output.Reasoning
Reuses the deliberately unicode-named lambda to test description output. Same intentional test content.
-
info
warn→ info by reviewdynamic-executionhypothesis/tests/ghostwriter/recorded/magic_builtins.txt:112:5eval(source, globals, locals)dismissed Recorded documentation text containing an eval example.Reasoning
This is recorded prose/doc output in a text file, showing an eval signature in an example. It is not executable code in the library and is markup text.
-
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 that execs ghostwriter-generated source to verify it is valid Python.Reasoning
This is a test in the Hypothesis ghostwriter test suite. The exec call runs generated source code the test itself produced, to check it has no SyntaxError or NameError. The base64 import is incidental to the test's purpose and not a decoding payload.
-
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 to confirm it runs cleanly.Reasoning
exec of a variable holding generated expected source in a test assertion context. This is a test-validation pattern, not an attack; the source is a fixture the test controls.
-
info
warn→ info by reviewdynamic-executionhypothesis/tests/ghostwriter/test_expected_output.py:317:5assert ==likely benign Test execs generated expected source to check it resolves names correctly.Reasoning
Same test pattern: exec on the expected generated source with a namespace containing a sentinel. Used to validate ghostwriter output in tests.
-
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 execs generated source to confirm validity.Reasoning
Repeated test pattern of exec on generated expected source to validate it compiles and runs; no network, decoding, or persistence behaviour.
-
likely benign Test helper execs generated source and logs it on exception.
Reasoning
Helper inside a test that execs generated source and prints it on failure for debugging. Standard test scaffolding for code generation.
-
=likely benign Test execs ghostwriter-generated source.Reasoning
Test calls ghostwriter.magic to generate source and execs it to ensure it runs. Expected for a code generator's test suite.
-
=likely benign Test execs generated binary-operation source.Reasoning
Generated binary-operation source is exec'd in a test to check it executes without error.
-
# Most importantly: the code should execute without NameErrorlikely benign Test execs generated code to check for NameError.Reasoning
Test comment explicitly states the purpose is that generated code runs without NameError. Standard validation.
-
= # and also works with explicit identity element =likely benign Test execs generated binary-operation source.Reasoning
Test execs generated binary-operation source, including an identity-element variant. Test-only code generation check.
-
=likely benign Test execs generated binary-operation source with identity.Reasoning
Same pattern as the preceding finding for the explicit-identity case.
-
assert inlikely benign Test execs generated one_of source after asserting its content.Reasoning
Test asserts generated source content and then execs it. Ordinary test of a code generator.
-
= # Also cover passing an explicit `annotate`, rather than the default None. =likely benign Test execs generated ufunc source.Reasoning
Test execs ufunc-generated source, including an annotate variant. Test-only validation.
-
=likely benign Test execs generated ufunc source with annotate.Reasoning
Same ufunc generated-source exec in a test with annotate=True.
-
info
critical→ info by reviewdynamic-executionhypothesis/tests/ghostwriter/test_ghostwriter_cli.py:43:12returnlikely benign Test helper wrapping subprocess.run with shell=True to invoke CLI commands.Reasoning
A small test-helper wrapper around subprocess.run for invoking the CLI in tests. shell=True is used with a test-supplied command string, not untrusted input from outside the test suite. Flagged as critical by pattern alone, but the context is a test runner utility.
-
= = = assert ==likely benign Test evals a strategy repr to verify round-trip stability.Reasoning
Test evals the repr of a Hypothesis strategy to check repr round-tripping. The input is strategy repr output generated within the test, so it is not attacker-controlled.
-
assert ==likely benign Test evals sampled strategy reprs for round-trip checks.Reasoning
Parametrized test evaluating sampled strategy reprs to check they round-trip. Test-only use of eval on controlled strings.
-
= = =likely benign A pytest test function uses eval on a parameter to build a numpy array for testing floor and ceil behavior.Reasoning
eval is called on a function parameter named value, so the input is non-literal and unvalidated. In a test file, this is most likely a parametrized test where value is a string literal like '[1.5, -2.5]' from a test decorator, used to build numpy arrays. Still, eval on arbitrary input is a risky pattern and the snippet does not show the callers, so the benign reading is the most likely but not certain.
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.
&&