Command-line interface

The hypothesis fuzz command is the main entrypoint to HypoFuzz. Installing HypoFuzz automatically adds the fuzz sub-command to the existing Hypothesis CLI.

hypothesis fuzz

$ hypothesis fuzz --help
Usage: hypothesis fuzz [OPTIONS] [-- PYTEST_ARGS]

  [hypofuzz] runs tests with an adaptive coverage-guided fuzzer.

  Unrecognised arguments are passed through to `pytest` to select the tests to
  run, with the additional constraint that only Hypothesis tests can be
  fuzzed.

  This process will run forever unless stopped with e.g. ctrl-C.

Options:
  -n, --numprocesses NUM        default: all available cores  [x>=1]
  --dashboard / --no-dashboard  serve / don't serve a live dashboard page
  -d, --dashboard-only          serve a live dashboard page without launching
                                associated fuzzing processes
  --host HOST                   Optional host for the dashboard
  --port PORT                   Optional port for the dashboard (if any). 0 to
                                request an arbitrary open port  [0<=x<=65535]
  -h, --help                    Show this message and exit.

Example usage

  • hypothesis fuzz starts the dashboard and fuzz workers, using all available cores.

  • hypothesis fuzz -n 2 starts the dashboard and fuzz workers, using 2 cores.

  • hypothesis fuzz --dashboard-only starts just the dashboard. The dashboard works even if no fuzz workers are running.

  • hypothesis fuzz --no-dashboard -n 4 starts just the fuzz workers, using 4 cores.

  • hypothesis fuzz -- -k parse starts the dashboard and fuzz workers only for test names with the string parse in them.