PyPI / hypothesis / 6.170.2

hypothesis 6.170.2

Source
https://github.com/HypothesisWorks/hypothesis
Tag scanned
v6.170.2
Directory
hypothesis (only this part of the repository was scanned)
Compared with
v6.170.1 (0 signals introduced since)
Files
537 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-20 00:56

Signals

Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.

  1. info critical → info by review dynamic-execution hypothesis/docs/conf.py:185:1

    `exec` at module scope (runs on import) on a non-literal expression (ast pass, confidence 0.80)

    _version_file = root.joinpath("src", "hypothesis", "version.py")
    exec(_version_file.read_text(encoding="utf-8"), _d)
    version = _d["__version__"]
    release = _d["__version__"]
    likely benign LLM, confidence 0.85 Docs config execs the project's own version.py to read __version__.
    Reasoning

    The exec reads version.py from the project's own source tree via a path joined from root and executes it into a dict to extract __version__. This is a common Sphinx docs idiom for single-sourcing the version; the content is the project's own file, not attacker-controlled network or encoded data. Flagged as critical by the scanner, but the context is benign.

  2. line length 1436 characters (raw pass, confidence 0.50)

    The following notable open-source projects use Hypothesis to test their code: `pytorch <https://github.com/pytorch/pytorch>`_, `jax <https://github.com/jax-ml/jax>`_, `PyPy <https://github.com/pypy/pypy>`_, `numpy <https://github.com/numpy/numpy>`_, `pandas <https://github.com/pandas-dev/pandas>`_, `attrs <https://gith
  3. info dynamic-execution hypothesis/scripts/basic-test.sh:26:1

    command name is a variable (`$PYTEST`) that this file sets only to plain text (ast pass, confidence 0.40)

    # Run all the no-extra-dependency tests for this version (except slow nocover tests)
    $PYTEST tests/cover tests/pytest
    
    # Run tests for each extra module while the requirements are installed
  4. info dynamic-execution hypothesis/scripts/basic-test.sh:30:1

    command name is a variable (`$PYTEST`) that this file sets only to plain text (ast pass, confidence 0.40)

    pip install ".[pytz, dateutil, zoneinfo]"
    $PYTEST tests/datetime/
    pip uninstall -y pytz python-dateutil
  5. info dynamic-execution hypothesis/scripts/basic-test.sh:34:1

    command name is a variable (`$PYTEST`) that this file sets only to plain text (ast pass, confidence 0.40)

    pip install ".[dpcontracts]"
    $PYTEST tests/dpcontracts/
    pip uninstall -y dpcontracts
  6. info dynamic-execution hypothesis/scripts/basic-test.sh:40:1

    command name is a variable (`$PYTEST`) that this file sets only to plain text (ast pass, confidence 0.40)

    pip install "$(grep 'fakeredis==' ../requirements/coverage.txt)"
    $PYTEST tests/redis/
    pip uninstall -y redis fakeredis
  7. info dynamic-execution hypothesis/scripts/basic-test.sh:44:1

    command name is a variable (`$PYTEST`) that this file sets only to plain text (ast pass, confidence 0.40)

    pip install "$(grep 'typing-extensions==' ../requirements/coverage.txt)"
    $PYTEST tests/typing_extensions/
    pip uninstall -y typing_extensions
  8. info dynamic-execution hypothesis/scripts/basic-test.sh:49:1

    command name is a variable (`$PYTEST`) that this file sets only to plain text (ast pass, confidence 0.40)

    pip install "$(grep -m 1 -oE 'lark>=([0-9.]+)' ../hypothesis/pyproject.toml | tr '>' =)"
    $PYTEST -Wignore tests/lark/
    pip install "$(grep 'lark==' ../requirements/coverage.txt)"
    $PYTEST tests/lark/
  9. info dynamic-execution hypothesis/scripts/basic-test.sh:51:1

    command name is a variable (`$PYTEST`) that this file sets only to plain text (ast pass, confidence 0.40)

    pip install "$(grep 'lark==' ../requirements/coverage.txt)"
    $PYTEST tests/lark/
    pip uninstall -y lark
  10. info dynamic-execution hypothesis/scripts/basic-test.sh:56:3

    command name is a variable (`$PYTEST`) that this file sets only to plain text (ast pass, confidence 0.40)

      pip install ".[codemods,cli]"
      $PYTEST tests/codemods/
      pip uninstall -y libcst click
  11. info dynamic-execution hypothesis/scripts/basic-test.sh:62:3

    command name is a variable (`$PYTEST`) that this file sets only to plain text (ast pass, confidence 0.40)

      pip install "$(grep -E 'black(==| @)' ../requirements/coverage.txt)"
      $PYTEST tests/ghostwriter/
      pip uninstall -y black numpy
    fi
  12. info dynamic-execution hypothesis/scripts/basic-test.sh:70:1

    command name is a variable (`$PYTEST`) that this file sets only to plain text (ast pass, confidence 0.40)

    
    $PYTEST tests/nocover/
    
    # Run some tests without docstrings or assertions, to catch bugs
  13. info dynamic-execution hypothesis/scripts/basic-test.sh:74:1

    command name is a variable (`$PYTEST`) that this file sets only to plain text (ast pass, confidence 0.40)

    # like issue #822 in one of the test decorators.  See also #1541.
    PYTHONOPTIMIZE=2 $PYTEST \
        -W'ignore:assertions not in test modules or plugins will be ignored because assert statements are not executed by the underlying Python interpreter:pytest.PytestConfigWarning' \
  14. info dynamic-execution hypothesis/scripts/basic-test.sh:89:5

    command name is a variable (`$PYTEST`) that this file sets only to plain text (ast pass, confidence 0.40)

        pip install "$NUMPY"
        $PYTEST tests/array_api
        $PYTEST tests/numpy
  15. info dynamic-execution hypothesis/scripts/basic-test.sh:90:5

    command name is a variable (`$PYTEST`) that this file sets only to plain text (ast pass, confidence 0.40)

        $PYTEST tests/array_api
        $PYTEST tests/numpy
    
        pip install "$(grep 'pandas==' ../requirements/coverage.txt)"
  16. info dynamic-execution hypothesis/scripts/basic-test.sh:93:5

    command name is a variable (`$PYTEST`) that this file sets only to plain text (ast pass, confidence 0.40)

        pip install "$(grep 'pandas==' ../requirements/coverage.txt)"
        $PYTEST tests/pandas
    esac
  17. command name is a variable (`$PYTEST`) that this file sets only to plain text (ast pass, confidence 0.40)

    # like issue #822 in one of the test decorators.  See also #1541.
    PYTHONOPTIMIZE=2 $PYTEST \
        -W'ignore:assertions not in test modules or plugins will be ignored because assert statements are not executed by the underlying Python interpreter:pytest.PytestConfigWarning' \
  18. command name is a variable (`$PYTEST`) that this file sets only to plain text (ast pass, confidence 0.40)

    pip install ".[pytz, dateutil, zoneinfo]"
    $PYTEST tests/datetime/
    pip uninstall -y pytz python-dateutil
  19. command name is a variable (`$PYTEST`) that this file sets only to plain text (ast pass, confidence 0.40)

    pip install ".[dpcontracts]"
    $PYTEST tests/dpcontracts/
    pip uninstall -y dpcontracts
  20. command name is a variable (`$PYTEST`) that this file sets only to plain text (ast pass, confidence 0.40)

    pip install attrs
    $PYTEST tests/attrs/
    pip uninstall -y attrs
  21. command name is a variable (`$PYTEST`) that this file sets only to plain text (ast pass, confidence 0.40)

    pip install scipy
    $PYTEST tests/scipy/
    pip uninstall -y scipy
  22. command name is a variable (`$PYTEST`) that this file sets only to plain text (ast pass, confidence 0.40)

    pip install "$(grep 'typing-extensions==' ../requirements/coverage.txt)"
    $PYTEST tests/redis/
    pip uninstall -y redis fakeredis
  23. command name is a variable (`$PYTEST`) that this file sets only to plain text (ast pass, confidence 0.40)

    
    $PYTEST tests/typing_extensions/
    if [ "$HYPOTHESIS_PROFILE" != "crosshair" ]; then
      pip uninstall -y typing-extensions
  24. command name is a variable (`$PYTEST`) that this file sets only to plain text (ast pass, confidence 0.40)

    pip install "$(grep 'annotated-types==' ../requirements/coverage.txt)"
    $PYTEST tests/test_annotated_types.py
    pip uninstall -y annotated-types
  25. command name is a variable (`$PYTEST`) that this file sets only to plain text (ast pass, confidence 0.40)

    pip install "$(grep -m 1 -oE 'lark>=([0-9.]+)' ../hypothesis/pyproject.toml | tr '>' =)"
    $PYTEST -Wignore tests/lark/
    pip install "$(grep 'lark==' ../requirements/coverage.txt)"
    $PYTEST tests/lark/
  26. command name is a variable (`$PYTEST`) that this file sets only to plain text (ast pass, confidence 0.40)

    pip install "$(grep 'lark==' ../requirements/coverage.txt)"
    $PYTEST tests/lark/
    pip uninstall -y lark
  27. command name is a variable (`$PYTEST`) that this file sets only to plain text (ast pass, confidence 0.40)

      pip install ".[codemods,cli]"
      $PYTEST tests/codemods/
    
      if [ "$(python -c 'import sys; print(sys.version_info[:2] == (3, 11))')" = "True" ] ; then
  28. command name is a variable (`$PYTEST`) that this file sets only to plain text (ast pass, confidence 0.40)

      pip install "$(grep -E 'black(==| @)' ../requirements/coverage.txt)"
      $PYTEST tests/patching/
      pip uninstall -y libcst
  29. command name is a variable (`$PYTEST`) that this file sets only to plain text (ast pass, confidence 0.40)

      pip install attrs
      $PYTEST tests/ghostwriter/
      pip uninstall -y attrs
      pip uninstall -y black
  30. command name is a variable (`$PYTEST`) that this file sets only to plain text (ast pass, confidence 0.40)

          pip install .
          $PYTEST --count=2 --repeat-scope=session tests/numpy tests/crosshair
          # ...but running twice takes time, don't overdo it
          $PYTEST tests/array_api
  31. command name is a variable (`$PYTEST`) that this file sets only to plain text (ast pass, confidence 0.40)

          # ...but running twice takes time, don't overdo it
          $PYTEST tests/array_api
        else
          $PYTEST tests/array_api tests/numpy
  32. command name is a variable (`$PYTEST`) that this file sets only to plain text (ast pass, confidence 0.40)

        else
          $PYTEST tests/array_api tests/numpy
        fi
      fi
  33. info warn → info by review frame-introspection hypothesis/src/hypothesis/control.py:50:13

    `inspect.currentframe` — call-stack frame introspection (ast pass, confidence 0.70)

            )
        frame = inspect.currentframe()
        where = _calling_function_location("reject", frame)
        if currently_in_test_context():
    likely benign LLM, confidence 0.93 Uses currentframe to report the calling location for reject().
    Reasoning

    inspect.currentframe is used to locate the caller for error messages in reject(). This is standard library introspection for diagnostics in a testing library, not malicious.

  34. info warn → info by review frame-introspection hypothesis/src/hypothesis/control.py:78:17

    `inspect.currentframe` — call-stack frame introspection (ast pass, confidence 0.70)

        if observability_enabled() or not condition:
            frame = inspect.currentframe()
            where = _calling_function_location("assume", frame)
            if observability_enabled() and currently_in_test_context():
    likely benign LLM, confidence 0.93 Uses currentframe to report the calling location for assume().
    Reasoning

    Same pattern as reject(): currentframe feeds _calling_function_location for assume() diagnostics. Legitimate use in a testing framework.

  35. info warn → info by review decoder-decompress-payload hypothesis/src/hypothesis/core.py:442:23

    file imports decoder module(s) base64, zlib and calls `.decompress()` — embedded payload decompressed at runtime (ast pass, confidence 0.75)

            try:
                decoded = zlib.decompress(decoded[1:])
            except zlib.error as err:
                raise InvalidArgument(
    likely benign LLM, confidence 0.90 Decompresses a versioned reproduction blob for Hypothesis failure replay.
    Reasoning

    This is zlib decompression of a blob with a version byte prefix, inside a try block catching zlib.error, in the context of decoding a reproduction blob (the Hypothesis @reproduce_failure feature). It is a legitimate serialization format, not a hidden dropper; the decoded data is then parsed as a choice sequence, not executed.

  36. info warn → info by review dynamic-execution hypothesis/src/hypothesis/extra/ghostwriter.py:293:17

    `compile` called on a non-literal expression (ast pass, confidence 0.70)

                with contextlib.suppress(SyntaxError):
                    compile(repr(st.just(param.default)), "<string>", "eval")
                    elements.insert(0, param.default)
            if elements or types:
    likely benign LLM, confidence 0.90 Syntax-checks a repr of a parameter default during code generation.
    Reasoning

    compile is used to validate that repr of a strategy default is a syntactically valid expression, with SyntaxError suppressed. It is a syntax check on generated repr text for code generation, not execution of untrusted input.

  37. info warn → info by review dynamic-execution hypothesis/src/hypothesis/extra/ghostwriter.py:719:9

    `compile` called on a non-literal expression (ast pass, confidence 0.70)

            r = re.sub(r"(lambda.*?: )(<unknown>)([,)])", r"\1...\3", r)
            compile(r, "<string>", "eval")
            # Finally, try to work out the imports we need for builds(), .map(),
            # .filter(), and .flatmap() to work without NameError
    likely benign LLM, confidence 0.90 Syntax-checks a generated expression string in the ghostwriter tool.
    Reasoning

    compile(r, '<string>', 'eval') validates a generated source expression for the ghostwriter tool, only checking syntax. No execution occurs.

  38. info warn → info by review dynamic-execution hypothesis/src/hypothesis/extra/ghostwriter.py:1837:13

    `compile` called on a non-literal expression (ast pass, confidence 0.70)

                # executed; so you still shouldn't ghostwrite for hostile code.
                compile(repr(identity), "<string>", "exec")
            except SyntaxError:
                identity = repr(identity)
    likely benign LLM, confidence 0.90 Syntax-checks a repr of an identity value during ghostwriting.
    Reasoning

    compile(repr(identity), ..., 'exec') is a syntax validity check on a repr string with SyntaxError handled. The comment in context acknowledges hostile code concerns elsewhere; this does not execute the code.

  39. identifier `aᵏ` mixes scripts: Latin + Other (in string/comment) (raw pass, confidence 0.40)

        # 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
  40. identifier `aᵐ` mixes scripts: Latin + Other (in string/comment) (raw pass, confidence 0.40)

        # 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
  41. identifier `aᵐ` mixes scripts: Latin + Other (in string/comment) (raw pass, confidence 0.40)

        # 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)
  42. identifier `aᵏ` mixes scripts: Latin + Other (in string/comment) (raw pass, confidence 0.40)

        # 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)
        def S(n):
            return alphabet_size ** (n + 1) - 1
  43. identifier `aᵏ` mixes scripts: Latin + Other (in string/comment) (raw pass, confidence 0.40)

        # 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)
        def S(n):
            return alphabet_size ** (n + 1) - 1
  44. identifier `aᵏ` mixes scripts: Latin + Other (in string/comment) (raw pass, confidence 0.40)

        # 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)
        def S(n):
            return alphabet_size ** (n + 1) - 1
  45. info warn → info by review frame-introspection hypothesis/src/hypothesis/internal/conjecture/junkdrawer.py:316:13

    `sys._getframe` — call-stack frame introspection (ast pass, confidence 0.70)

        """
        frame = sys._getframe(2)
        size = 1
        while frame:
    likely benign LLM, confidence 0.93 Walks stack frames via sys._getframe to compute a size helper.
    Reasoning

    sys._getframe(2) walks the stack to compute a size or depth for a utility routine. Standard introspection in a property-testing library.

  46. identifier `ˆøπ` mixes scripts: Other + Latin + Greek (in string/comment) (raw pass, confidence 0.40)

        # common unicode characters
        "Ω≈ç√∫˜µ≤≥÷åß∂ƒ©˙∆˚¬…æœ∑´®†¥¨ˆøπ“‘¡™£¢∞§¶•ªº–≠¸˛Ç◊ı˜Â¯˘¿ÅÍÎÏ˝ÓÔ⟨U+F8FF⟩ÒÚÆ☃Œ„´‰ˇÁ¨ˆØ∏”’`⁄€‹›fifl‡°·‚—±",
        # characters which increase in length when lowercased
  47. identifier `ˇÁ` mixes scripts: Other + Latin (in string/comment) (raw pass, confidence 0.40)

        # common unicode characters
        "Ω≈ç√∫˜µ≤≥÷åß∂ƒ©˙∆˚¬…æœ∑´®†¥¨ˆøπ“‘¡™£¢∞§¶•ªº–≠¸˛Ç◊ı˜Â¯˘¿ÅÍÎÏ˝ÓÔ⟨U+F8FF⟩ÒÚÆ☃Œ„´‰ˇÁ¨ˆØ∏”’`⁄€‹›fifl‡°·‚—±",
        # characters which increase in length when lowercased
  48. identifier `ˆØ` mixes scripts: Other + Latin (in string/comment) (raw pass, confidence 0.40)

        # common unicode characters
        "Ω≈ç√∫˜µ≤≥÷åß∂ƒ©˙∆˚¬…æœ∑´®†¥¨ˆøπ“‘¡™£¢∞§¶•ªº–≠¸˛Ç◊ı˜Â¯˘¿ÅÍÎÏ˝ÓÔ⟨U+F8FF⟩ÒÚÆ☃Œ„´‰ˇÁ¨ˆØ∏”’`⁄€‹›fifl‡°·‚—±",
        # characters which increase in length when lowercased
  49. identifier `æœÆŒffʤʨß` mixes scripts: Latin + Other (in string/comment) (raw pass, confidence 0.40)

        # ligatures
        "æœÆŒffʤʨß",
        # emoticons
        "(╯°□°)╯︵ ┻━┻)",
  50. identifier `ʇǝɯɐ` mixes scripts: Other + Latin (in string/comment) (raw pass, confidence 0.40)

        # upsidown text
        "ʇǝɯɐ ʇᴉs ɹolop ɯnsdᴉ ɯǝɹo˥",
        # reserved strings in windows
        "NUL",
  51. identifier `ʇᴉs` mixes scripts: Other + Latin (in string/comment) (raw pass, confidence 0.40)

        # upsidown text
        "ʇǝɯɐ ʇᴉs ɹolop ɯnsdᴉ ɯǝɹo˥",
        # reserved strings in windows
        "NUL",
  52. identifier `ɹolop` mixes scripts: Other + Latin (in string/comment) (raw pass, confidence 0.40)

        # upsidown text
        "ʇǝɯɐ ʇᴉs ɹolop ɯnsdᴉ ɯǝɹo˥",
        # reserved strings in windows
        "NUL",
  53. identifier `ɯnsdᴉ` mixes scripts: Other + Latin (in string/comment) (raw pass, confidence 0.40)

        # upsidown text
        "ʇǝɯɐ ʇᴉs ɹolop ɯnsdᴉ ɯǝɹo˥",
        # reserved strings in windows
        "NUL",
  54. identifier `ɯǝɹo` mixes scripts: Other + Latin (in string/comment) (raw pass, confidence 0.40)

        # upsidown text
        "ʇǝɯɐ ʇᴉs ɹolop ɯnsdᴉ ɯǝɹo˥",
        # reserved strings in windows
        "NUL",
  55. identifier `ͅi` mixes scripts: Other + Latin (in string/comment) (raw pass, confidence 0.40)

    �̲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̗̦̲.̨̹͈̣",
  56. identifier `iͅn` mixes scripts: Latin + Other (in string/comment) (raw pass, confidence 0.40)

    �̜̣̲ͅ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̗̦̲.̨̹͈̣",
  57. identifier `ͅi` mixes scripts: Other + Latin (in string/comment) (raw pass, confidence 0.40)

    �̲͚̬͜ǹ̬͎͎̟̖͇̤t͍̬̤͓̼̭͘ͅi̪̱n͠g̴͉ ⟨U+034F⟩͉ͅc̬̟h͡a̫̻̯͘o̫̟̖͍̙̝͉s̗̦̲.̨̹͈̣",
  58. identifier `ͅc` mixes scripts: Other + Latin (in string/comment) (raw pass, confidence 0.40)

    �͇̤t͍̬̤͓̼̭͘ͅi̪̱n͠g̴͉ ⟨U+034F⟩͉ͅc̬̟h͡a̫̻̯͘o̫̟̖͍̙̝͉s̗̦̲.̨̹͈̣",
  59. info warn → info by review frame-introspection hypothesis/src/hypothesis/internal/coverage.py:74:18

    `sys._getframe` — call-stack frame introspection (ast pass, confidence 0.70)

            # stack frames up.
            caller = sys._getframe(depth + 2)
            fname = pretty_file_name(caller.f_code.co_filename)
            local_description = f"{name} at {fname}:{caller.f_lineno}"
    likely benign LLM, confidence 0.93 Reads caller frame file and line to describe a coverage target.
    Reasoning

    sys._getframe is used to label coverage/observability entries with the caller's file and line. Diagnostic introspection, benign.

  60. info warn → info by review dynamic-execution hypothesis/src/hypothesis/internal/lambda_sources.py:265:20

    `eval` called on a non-literal expression (ast pass, confidence 0.70)

        if not f_code.co_freevars and not referenced_modules:
            compiled = eval(source, f_globals)
        else:
            if f_code.co_freevars:
    likely benign LLM, confidence 0.85 Evals reconstructed lambda source to rebuild a function object for reflection.
    Reasoning

    eval of a reconstructed lambda source string with the module's globals is how Hypothesis recovers lambda objects for repr and reflection. The source comes from the function's own code and the user's test definitions, so this is an expected reflective pattern, though eval is inherently risky.

  61. info warn → info by review dynamic-execution hypothesis/src/hypothesis/internal/lambda_sources.py:298:9

    `exec` called on a non-literal expression (ast pass, confidence 0.70)

            )
            exec(exec_str, f_globals)
            compiled = f_globals["__construct_lambda"]()
    likely benign LLM, confidence 0.85 Execs generated source to reconstruct a lambda with closure variables.
    Reasoning

    exec of a generated construct-lambda string rebuilds a closure with free variables. The string is built internally from the function's own source and closure names, so this is a legitimate reflection technique rather than a dropper.

  62. info warn → info by review dynamic-execution hypothesis/src/hypothesis/internal/reflection.py:367:5

    `exec` called on a non-literal expression (ast pass, confidence 0.70)

        assert isinstance(source, str)
        exec(source, result.__dict__)
        eval_cache[source] = result
        return result
    likely benign LLM, confidence 0.85 Execs recorded function source into a module dict for reflection.
    Reasoning

    exec of source into a result module dict is the mechanism used to materialize a function from its recorded source for reflection, with caching. The source originates from the library's own reflection of existing code, not from an external payload.

  63. info warn → info by review frame-introspection hypothesis/src/hypothesis/internal/scrutineer.py:114:13

    `sys.settrace` — call-stack frame introspection (ast pass, confidence 0.70)

            if not hasattr(sys, "monitoring"):  # pragma: no cover  # only on Python < 3.12
                sys.settrace(self.trace)
                return self
    likely benign LLM, confidence 0.93 Installs a trace function to observe execution during scrutiny.
    Reasoning

    sys.settrace installs a tracer for coverage/scrutiny of the test under execution, guarded for Python versions lacking sys.monitoring. A standard profiling technique in a testing library.

  64. info warn → info by review frame-introspection hypothesis/src/hypothesis/internal/scrutineer.py:137:13

    `sys.settrace` — call-stack frame introspection (ast pass, confidence 0.70)

            if not hasattr(sys, "monitoring"):  # pragma: no cover  # only on Python < 3.12
                sys.settrace(None)
                return
    likely benign LLM, confidence 0.93 Removes the trace function installed for scrutiny.
    Reasoning

    Paired sys.settrace(None) removing the tracer installed earlier. Same benign profiling context.

  65. info warn → info by review frame-introspection hypothesis/src/hypothesis/strategies/_internal/strategies.py:102:31

    `sys._getframe` — call-stack frame introspection (ast pass, confidence 0.70)

            return location
        frame: FrameType | None = sys._getframe(1)
        while frame is not None and is_hypothesis_file(frame.f_code.co_filename):
            frame = frame.f_back
    likely benign LLM, confidence 0.90 Call-stack walk to find the user's source location for strategy reporting.
    Reasoning

    sys._getframe(1) walks up past Hypothesis's own files to locate the user's calling code for reporting. This is a standard, legitimate use in a testing library and does not execute anything.

  66. info warn → info by review frame-introspection hypothesis/src/hypothesis/strategies/_internal/types.py:227:37

    `sys._getframe` — call-stack frame introspection (ast pass, confidence 0.70)

        found_loc: str | None = None
        frame: types.FrameType | None = sys._getframe()
        while frame is not None:
            loc = f"{frame.f_code.co_filename}:{frame.f_lineno}"
    likely benign LLM, confidence 0.90 Frame walk recording caller file and line for diagnostics.
    Reasoning

    sys._getframe() walks frames to record file and line locations for type-resolution diagnostics. It is read-only introspection with no dropper or obfuscation behaviour.

  67. info critical → info by review dynamic-execution hypothesis/tests/codemods/test_codemod_cli.py:40:12

    `subprocess.run` with `shell=True` and a non-literal command — runtime-determined shell invocation (ast pass, confidence 0.85)

    def run(command, *, cwd=None, input=None):
        return subprocess.run(
            command,
            input=input,
    likely benign LLM, confidence 0.80 Test helper running CLI command strings through the shell.
    Reasoning

    A small test helper wraps subprocess.run with shell=True so tests can run CLI command strings. The command comes from test code, not untrusted input, so this is a test convenience rather than an attack.

  68. info warn → info by review frame-introspection hypothesis/tests/conjecture/test_junkdrawer.py:201:16

    `inspect.stack` — call-stack frame introspection (ast pass, confidence 0.70)

    def recur(i):
        assert len(inspect.stack(0)) == stack_depth_of_caller()
        if i >= 1:
            recur(i - 1)
    likely benign LLM, confidence 0.90 Test asserting stack depth via inspect.stack.
    Reasoning

    inspect.stack(0) is used in a test to check that the stack depth matches the caller's. It is a plain test assertion on stack structure.

  69. info warn → info by review dynamic-execution hypothesis/tests/cover/test_feature_flags.py:58:14

    `eval` called on a non-literal expression (ast pass, confidence 0.70)

        assert not flags.is_enabled("off")
        flags2 = eval(repr(flags))
        assert flags2.is_enabled("on")
        assert not flags2.is_enabled("off")
    likely benign LLM, confidence 0.90 Round-trip repr test for FeatureFlags via eval.
    Reasoning

    eval(repr(flags)) is a round-trip test checking that the FeatureFlags repr reconstructs an equivalent object. The input is the library's own repr output.

  70. info warn → info by review dynamic-execution hypothesis/tests/cover/test_feature_flags.py:72:14

    `eval` called on a non-literal expression (ast pass, confidence 0.70)

    
        flags2 = eval(repr(flags))
    
        for f in features:
    likely benign LLM, confidence 0.90 Repr round-trip test for feature flags.
    Reasoning

    Same round-trip pattern: eval of the object's own repr in a unit test to confirm serialization fidelity.

  71. info warn → info by review frame-introspection hypothesis/tests/cover/test_observability.py:337:13

    `inspect.currentframe` — call-stack frame introspection (ast pass, confidence 0.70)

        # the line `offset` lines below the `def` statement of the calling function
        frame = inspect.currentframe().f_back
        return f"{__file__}:{frame.f_code.co_firstlineno + offset}"
    likely benign LLM, confidence 0.90 Test computing an expected caller file and line.
    Reasoning

    inspect.currentframe().f_back reads the caller's line number so the test can compute an expected source location. Benign test introspection.

  72. info warn → info by review dynamic-execution hypothesis/tests/cover/test_pretty.py:596:14

    `eval` called on a non-literal expression (ast pass, confidence 0.70)

        ]:
            r2 = eval(pretty.pretty(r), globals())
            assert r.pattern == r2.pattern
            assert r.flags == r2.flags
    likely benign LLM, confidence 0.90 Round-trip test that evals pretty-printed regex.
    Reasoning

    eval of pretty-printed regex output inside a round-trip test to confirm the pretty printer produces valid, equivalent code.

  73. info warn → info by review dynamic-execution hypothesis/tests/cover/test_pretty.py:625:9

    `eval` called on a non-literal expression (ast pass, confidence 0.70)

        assert float_to_lex(obj) == float_to_lex(
            eval(rep, {"struct": struct, "nan": float("nan")})
        )
    likely benign LLM, confidence 0.90 Test evaluating a float repr in a restricted namespace.
    Reasoning

    eval of a repr string with a restricted namespace in a float-round-trip test. It evaluates known repr output in a test, not untrusted data.

  74. info warn → info by review dynamic-execution hypothesis/tests/cover/test_pretty.py:686:26

    `eval` called on a non-literal expression (ast pass, confidence 0.70)

    def test_pretty_prints_enums_as_code(rep):
        assert pretty.pretty(eval(rep)) == rep
    likely benign LLM, confidence 0.90 Parametrised test evaluating enum source strings.
    Reasoning

    Test evaluating the rep parameter, a fixed parametrised string of enum source code, to check pretty-printing round-trips.

  75. info warn → info by review dynamic-execution hypothesis/tests/cover/test_pretty.py:770:12

    `eval` called on a non-literal expression (ast pass, confidence 0.70)

        assert got == f"{x:#_x}"  # hexadecimal with underscores
        assert eval(got) == x
    likely benign LLM, confidence 0.90 Test evaluating a formatted hex literal back to its value.
    Reasoning

    eval(got) checks that a formatted hex-with-underscores literal evaluates back to the original value. It is a test assertion on a known literal.

  76. info warn → info by review decoder-import-with-exec hypothesis/tests/cover/test_reproduce_failure.py:146:20

    file imports decoder module(s) base64, zlib and calls `exec`/`eval`/`compile` — multi-stage payload shape (ast pass, confidence 0.80)

        extract = exp.search(notes)
        reproduction = eval(extract.group(0))
        test = reproduction(test)
    likely benign LLM, confidence 0.70 Test decoding and evaluating a reproduction blob from failure notes.
    Reasoning

    The file imports base64 and zlib alongside eval. This is Hypothesis's reproduce_failure decode path: it regex-extracts a reproduction expression from the test's own notes and evals it. The decoder-plus-exec shape is real, but it appears in a test verifying the library's own feature, so it is most likely benign.

  77. info warn → info by review dynamic-execution hypothesis/tests/cover/test_reproduce_failure.py:146:20

    `eval` called on a non-literal expression (ast pass, confidence 0.70)

        extract = exp.search(notes)
        reproduction = eval(extract.group(0))
        test = reproduction(test)
    likely benign LLM, confidence 0.70 Eval of the regex-extracted reproduction expression.
    Reasoning

    The eval is applied to a regex match of the library's own reproduction expression. That is the same benign path as the decoder-import finding, so it is most likely benign.

  78. identifier `te02тест49st` contains homoglyph candidates: е (0435)→e, с (0441)→c (in string/comment) (raw pass, confidence 0.35)

        with pytest.raises(InvalidArgument):
            check_can_generate_examples(characters(include_characters="te02тест49st"))
  79. identifier `te02тест49st` mixes scripts: Latin + Cyrillic (in string/comment) (raw pass, confidence 0.40)

        with pytest.raises(InvalidArgument):
            check_can_generate_examples(characters(include_characters="te02тест49st"))
  80. identifier `te02тест49st` contains homoglyph candidates: е (0435)→e, с (0441)→c (in string/comment) (raw pass, confidence 0.35)

    def test_whitelisted_characters_overlap_blacklisted_characters():
        good_chars = "te02тест49st"
        bad_chars = "ts94тсет"
        with pytest.raises(InvalidArgument) as exc:
  81. identifier `te02тест49st` mixes scripts: Latin + Cyrillic (in string/comment) (raw pass, confidence 0.40)

    def test_whitelisted_characters_overlap_blacklisted_characters():
        good_chars = "te02тест49st"
        bad_chars = "ts94тсет"
        with pytest.raises(InvalidArgument) as exc:
  82. identifier `ts94тсет` contains homoglyph candidates: с (0441)→c, е (0435)→e (in string/comment) (raw pass, confidence 0.35)

        good_chars = "te02тест49st"
        bad_chars = "ts94тсет"
        with pytest.raises(InvalidArgument) as exc:
            check_can_generate_examples(
  83. identifier `ts94тсет` mixes scripts: Latin + Cyrillic (in string/comment) (raw pass, confidence 0.40)

        good_chars = "te02тест49st"
        bad_chars = "ts94тсет"
        with pytest.raises(InvalidArgument) as exc:
            check_can_generate_examples(
  84. identifier `teтестst` contains homoglyph candidates: е (0435)→e, с (0441)→c (in string/comment) (raw pass, confidence 0.35)

    def test_whitelisted_characters_override():
        good_characters = "teтестst"
        st = characters(
            min_codepoint=ord("0"),
  85. identifier `teтестst` mixes scripts: Latin + Cyrillic (in string/comment) (raw pass, confidence 0.40)

    def test_whitelisted_characters_override():
        good_characters = "teтестst"
        st = characters(
            min_codepoint=ord("0"),
  86. identifier `te02тест49st` contains homoglyph candidates: е (0435)→e, с (0441)→c (in string/comment) (raw pass, confidence 0.35)

    def test_blacklisted_characters():
        bad_chars = "te02тест49st"
        st = characters(
            min_codepoint=ord("0"), max_codepoint=ord("9"), exclude_characters=bad_chars
  87. identifier `te02тест49st` mixes scripts: Latin + Cyrillic (in string/comment) (raw pass, confidence 0.40)

    def test_blacklisted_characters():
        bad_chars = "te02тест49st"
        st = characters(
            min_codepoint=ord("0"), max_codepoint=ord("9"), exclude_characters=bad_chars
  88. info warn → info by review unicode-mixed-script hypothesis/tests/cover/test_unicode_identifiers.py:37:1

    identifier `is_approx_π` mixes scripts: Latin + Greek (raw pass, confidence 0.80)

    
    is_approx_π = lambda x: x == 3.1415
    likely benign LLM, confidence 0.95 Intentional unicode identifier in a unicode-handling test.
    Reasoning

    A Greek π identifier mixed with Latin letters is deliberate: the test exists to verify Hypothesis handles unicode identifiers. It is a legitimate test fixture, not obfuscation.

  89. info warn → info by review unicode-mixed-script hypothesis/tests/cover/test_unicode_identifiers.py:41:44

    identifier `is_approx_π` mixes scripts: Latin + Greek (raw pass, confidence 0.80)

    def test_can_handle_unicode_identifier_in_same_line_as_lambda_def():
        assert get_pretty_function_description(is_approx_π) == "lambda x: x == 3.1415"
    likely benign LLM, confidence 0.95 Unicode-identifier test for lambda source descriptions.
    Reasoning

    Same intentional mixed-script identifier, used to check source-description output for unicode lambda names.

  90. info warn → info by review dynamic-execution hypothesis/tests/ghostwriter/recorded/magic_builtins.txt:112:5

    [markup prose] `eval` called on a string literal (ast pass, confidence 0.85)

        eval(source, globals, locals)
    dismissed LLM, confidence 0.90 Eval appearing in a recorded documentation fixture.
    Reasoning

    The file is a recorded text output fixture for ghostwriter, and the eval appears in prose or markup text, not as executed code. It is not an execution vector.

  91. info warn → info by review decoder-import-with-exec hypothesis/tests/ghostwriter/test_expected_output.py:302:5

    file imports decoder module(s) base64 and calls `exec`/`eval`/`compile` — multi-stage payload shape (ast pass, confidence 0.80)

        assert actual == expected  # We got the expected source code
        exec(expected, {})  # and there are no SyntaxError or NameErrors
    likely benign LLM, confidence 0.93 Test helper executes generated Python source to verify it compiles and runs.
    Reasoning

    This is a Hypothesis ghostwriter test that execs generated source code in a test to check it is valid. The base64 import is incidental to the test module, and exec of generated test code is the purpose of the test.

  92. info warn → info by review dynamic-execution hypothesis/tests/ghostwriter/test_expected_output.py:302:5

    `exec` called on a non-literal expression (ast pass, confidence 0.70)

        assert actual == expected  # We got the expected source code
        exec(expected, {})  # and there are no SyntaxError or NameErrors
    likely benign LLM, confidence 0.93 exec on expected source string in a ghostwriter output test.
    Reasoning

    exec of a variable holding expected generated source in a test assertion context; no external or encoded input is involved.

  93. info warn → info by review dynamic-execution hypothesis/tests/ghostwriter/test_expected_output.py:317:5

    `exec` called on a non-literal expression (ast pass, confidence 0.70)

            assert actual == expected
        exec(expected, {"not_set": not_set})
    likely benign LLM, confidence 0.93 Test exec of generated code with a namespace.
    Reasoning

    Same test pattern: exec of generated code with a namespace dict to confirm it runs without NameError.

  94. info warn → info by review dynamic-execution hypothesis/tests/ghostwriter/test_expected_output.py:339:5

    `exec` called on a non-literal expression (ast pass, confidence 0.70)

        assert actual == expected  # We got the expected source code
        exec(expected, {})  # and there are no SyntaxError or NameErrors
    likely benign LLM, confidence 0.93 Test exec of expected generated source.
    Reasoning

    Same benign test pattern of executing expected generated source.

  95. info warn → info by review dynamic-execution hypothesis/tests/ghostwriter/test_ghostwriter.py:56:9

    `exec` called on a non-literal expression (ast pass, confidence 0.70)

        try:
            exec(source_code, namespace)
        except Exception:
            print(f"************\n{source_code}\n************")
    likely benign LLM, confidence 0.93 Test helper that execs generated code and prints it on exception.
    Reasoning

    Helper executes generated source inside a try block and prints it on failure; a standard test-harness pattern for checking generated code.

  96. info warn → info by review dynamic-execution hypothesis/tests/ghostwriter/test_ghostwriter.py:206:5

    `exec` called on a non-literal expression (ast pass, confidence 0.70)

        source_code = ghostwriter.magic(socket)
        exec(source_code, {})
    likely benign LLM, confidence 0.92 Test execs ghostwriter-generated source.
    Reasoning

    exec of output from ghostwriter.magic in a test; the code is generated by the library under test, not untrusted input.

  97. info warn → info by review dynamic-execution hypothesis/tests/ghostwriter/test_ghostwriter.py:213:5

    `exec` called on a non-literal expression (ast pass, confidence 0.70)

        source_code = ghostwriter.binary_operation(takes_frozensets)
        exec(source_code, {})
    likely benign LLM, confidence 0.92 Test execs generated binary operation source.
    Reasoning

    exec of ghostwriter.binary_operation output in a test to verify it runs.

  98. info warn → info by review dynamic-execution hypothesis/tests/ghostwriter/test_ghostwriter.py:234:5

    `exec` called on a non-literal expression (ast pass, confidence 0.70)

        # Most importantly: the code should execute without NameError
        exec(source_code, {})
    likely benign LLM, confidence 0.92 Test execs generated source to check for NameErrors.
    Reasoning

    Test comment states the goal is that the code runs without NameError; exec of generated code is the test intent.

  99. info warn → info by review dynamic-execution hypothesis/tests/ghostwriter/test_ghostwriter.py:436:5

    `exec` called on a non-literal expression (ast pass, confidence 0.70)

        source_code = ghostwriter.binary_operation(compose_types)
        exec(source_code, {})
        # and also works with explicit identity element
        source_code = ghostwriter.binary_operation(compose_types, identity=type)
    likely benign LLM, confidence 0.92 Test execs generated binary operation code.
    Reasoning

    Test execs output of ghostwriter.binary_operation, consistent with the rest of the test module.

  100. info warn → info by review dynamic-execution hypothesis/tests/ghostwriter/test_ghostwriter.py:439:5

    `exec` called on a non-literal expression (ast pass, confidence 0.70)

        source_code = ghostwriter.binary_operation(compose_types, identity=type)
        exec(source_code, {})
    likely benign LLM, confidence 0.92 Test execs generated code with explicit identity.
    Reasoning

    Same benign test pattern exec on generated binary operation source.

  101. info warn → info by review dynamic-execution hypothesis/tests/ghostwriter/test_ghostwriter.py:846:5

    `exec` called on a non-literal expression (ast pass, confidence 0.70)

        assert "one_of(" in source_code
        exec(source_code, {})
    likely benign LLM, confidence 0.92 Test execs generated one_of source.
    Reasoning

    Test execs generated source from ghostwriter.

  102. info warn → info by review dynamic-execution hypothesis/tests/ghostwriter/test_ghostwriter.py:854:5

    `exec` called on a non-literal expression (ast pass, confidence 0.70)

        source_code = ghostwriter.ufunc(numpy.isnan)
        exec(source_code, {})
        # Also cover passing an explicit `annotate`, rather than the default None.
        source_code = ghostwriter.ufunc(numpy.isnan, annotate=True)
    likely benign LLM, confidence 0.92 Test execs generated ufunc source.
    Reasoning

    Test execs ghostwriter.ufunc output; benign test verification.

  103. info warn → info by review dynamic-execution hypothesis/tests/ghostwriter/test_ghostwriter.py:857:5

    `exec` called on a non-literal expression (ast pass, confidence 0.70)

        source_code = ghostwriter.ufunc(numpy.isnan, annotate=True)
        exec(source_code, {})
    likely benign LLM, confidence 0.92 Test execs generated ufunc source with annotate.
    Reasoning

    Same benign ufunc test exec pattern.

  104. info critical → info by review dynamic-execution hypothesis/tests/ghostwriter/test_ghostwriter_cli.py:43:12

    `subprocess.run` with `shell=True` and a non-literal command — runtime-determined shell invocation (ast pass, confidence 0.85)

    def run(cmd, *, cwd=None):
        return subprocess.run(
            cmd, capture_output=True, shell=True, text=True, cwd=cwd, encoding="utf-8"
        )
    likely benign LLM, confidence 0.88 Test helper wrapping subprocess.run with shell=True for CLI tests.
    Reasoning

    Test helper runs a command string with shell=True; the cmd is passed by test code controlling the CLI invocation, a common test utility, not attacker-controlled input in shipped code.

  105. info warn → info by review dynamic-execution hypothesis/tests/nocover/test_pretty_repr.py:102:16

    `eval` called on a non-literal expression (ast pass, confidence 0.70)

        r = repr(strategy)
        via_eval = eval(r, strategy_globals)
        r2 = repr(via_eval)
        assert r == r2
    likely benign LLM, confidence 0.90 Test evals a strategy repr to verify round-trip stability.
    Reasoning

    Round-trip test evaluating repr output of a strategy in a controlled namespace to check repr stability; test-only code.

  106. info warn → info by review dynamic-execution hypothesis/tests/nocover/test_pretty_repr.py:116:17

    `eval` called on a non-literal expression (ast pass, confidence 0.70)

    def test_sampled_transform_reprs(r):
        assert repr(eval(r, strategy_globals)) == r
    likely benign LLM, confidence 0.90 Test evals sampled transform reprs for round-trip check.
    Reasoning

    Parametrized test evaluating repr strings of transforms; benign test code verifying repr round-trip.

  107. info warn → info by review dynamic-execution hypothesis/tests/numpy/test_floor_ceil.py:35:18

    `eval` called on a non-literal expression (ast pass, confidence 0.70)

    def test_our_floor_and_ceil_avoid_numpy_rounding(value):
        a = np.array(eval(value))
        f = floor(a)
        c = ceil(a)
    likely benign LLM, confidence 0.70 A numpy test helper calls eval on a parameter to build an array for comparing floor and ceil behavior.
    Reasoning

    eval is called on a function parameter named value, so the expression is non-literal and dynamic execution is a real concern in general. However, the file is a test under tests/numpy, the parameter is likely supplied by pytest parametrization with literal array expressions, and the surrounding code is a plain numerical comparison of floor and ceil. This reads as a lazy test-data pattern rather than malicious execution, though the snippet cannot confirm the parameter sources.

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.

cargo install disclude --version 4.0.0
git clone https://github.com/HypothesisWorks/hypothesis hypothesis && cd hypothesis
git checkout v6.170.2
disclude scan --severity info --diff v6.170.1 hypothesis