PyPI / hypothesis / 6.170.3

hypothesis 6.170.3

Source
https://github.com/HypothesisWorks/hypothesis
Tag scanned
v6.170.3
Directory
hypothesis (only this part of the repository was scanned)
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+…⟩.

  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 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.

  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():
    dismissed LLM, confidence 0.92 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.

  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():
    dismissed LLM, confidence 0.92 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.

  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 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.

  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 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.

  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.88 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.

  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 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.

  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:
    dismissed LLM, confidence 0.92 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.

  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}"
    dismissed LLM, confidence 0.92 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.

  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.88 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.

  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 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.

  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 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.

  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
    dismissed LLM, confidence 0.92 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.

  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
    dismissed LLM, confidence 0.92 Clears the trace function on exit.
    Reasoning

    Removes the trace function set in the paired __enter__, a normal teardown for the tracer above. Benign.

  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 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.

  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 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.

  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.75 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.

  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 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.

  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.92 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.

  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.92 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.

  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 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.

  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.92 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.

  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.92 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.

  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.92 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.

  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.92 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.

  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.75 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.

  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.75 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.

  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 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.

  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 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.

  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.95 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.

  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 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.

  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 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.

  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 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.

  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 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.

  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 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.

  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 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.

  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 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.

  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 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.

  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 exec of binary operation generated source.
    Reasoning

    Test execution of ghostwriter.binary_operation output, including an identity variant; benign test verification.

  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 exec of binary operation source with explicit identity.
    Reasoning

    Same benign test pattern executing 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 exec of generated source containing one_of.
    Reasoning

    Test exec of ghostwriter-generated source checking for one_of strategy text; benign.

  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 exec of generated ufunc test source.
    Reasoning

    Test exec of ghostwriter.ufunc output for numpy.isnan; benign verification of generated code.

  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 exec of annotated ufunc generated source.
    Reasoning

    Test exec of ufunc generated source with annotate=True; benign test code.

  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.90 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.

  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 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.

  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 eval of sampled strategy reprs for round-trip assertion.
    Reasoning

    Parametrized test evaluating sampled transform reprs to confirm they round-trip; benign test logic.

  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.80 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.

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