0

Property based framework QuickCheck can be instructed to measure how often a particular test case is generated by using collect and measure utility functions (for example: how often the same person on average places an order, how often empty orders are placed). Is there a possibility to adjust the distribution of test cases generated by a rule based statemachine in Hypothesis framework as in Quickcheck?

Aniket
  • 11
  • 4

1 Answers1

0

You can see the frequency of custom events using the event() function and the --hypothesis-show-statistics argument to pytest.

Our stateful testing doesn't support user-defined distributions, which we have found are usually counter-productive, but we do automatically use Swarm Testing to give you an empirically better-than-naive-random distribution - see https://hypothesis.readthedocs.io/en/latest/changes.html#v4-49-0 - among other tricks.

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