1

Is it possible to see (and hopefully save) the input data generated by hypothesis? I've been digging through the docs, but have so far been unable to find anything.

My end goal is to use the generated input data to validate that the new python version of various functions matches the old Matlab version.

natemcintosh
  • 730
  • 6
  • 16
  • 1
    It looks like you might be after the `database` argument of [`hypothesis.settings`](https://hypothesis.readthedocs.io/en/latest/settings.html#available-settings). "An instance of ExampleDatabase that will be used to save examples to and load previous examples from. May be None in which case no storage will be used." – Cory Kramer Jul 14 '21 at 19:21

1 Answers1

2

See all examples: try the verbosity setting, e.g. with pytest --hypothesis-verbosity=verbose

Save all examples: all interesting (failing plus some others) examples are automatically saved in an opaque database. If you want to do something else with them, you can run your 'save' code inside the test function on each input?

Zac Hatfield-Dodds
  • 2,455
  • 6
  • 19