.. title:: fuzz lisa.fuzz ========= .. toctree:: :hidden: Bool Choice Choices Dict Float Gen GenMonad Int Set Shuffle SortedList Tuple retry_until RetryException .. module:: lisa.fuzz .. withrefctx:: :module: lisa.fuzz .. automodule:: lisa.fuzz :no-index: :no-members: :no-inherited-members: :no-undoc-members: :no-private-members: :no-special-members: .. rubric:: Classes .. list-table:: :align: left * - :class:`~lisa.fuzz.Bool` - .. withrefctx:: :module: lisa.fuzz :class: lisa.fuzz.Bool Draw a random bool. * - :class:`~lisa.fuzz.Choice` - .. withrefctx:: :module: lisa.fuzz :class: lisa.fuzz.Choice Randomly choose one values among ``xs``. * - :class:`~lisa.fuzz.Choices` - .. withrefctx:: :module: lisa.fuzz :class: lisa.fuzz.Choices Randomly choose ``n`` values among ``xs``. * - :class:`~lisa.fuzz.Dict` - .. withrefctx:: :module: lisa.fuzz :class: lisa.fuzz.Dict Same as :class:`lisa.fuzz.Choices` but returns a dictionary. * - :class:`~lisa.fuzz.Float` - .. withrefctx:: :module: lisa.fuzz :class: lisa.fuzz.Float Draw a random float fitting within the ``[min_, max_]`` range. * - :class:`~lisa.fuzz.Gen` - .. withrefctx:: :module: lisa.fuzz :class: lisa.fuzz.Gen * - :class:`~lisa.fuzz.GenMonad` - .. withrefctx:: :module: lisa.fuzz :class: lisa.fuzz.GenMonad Random generator monad inspired by Haskell's QuickCheck. * - :class:`~lisa.fuzz.Int` - .. withrefctx:: :module: lisa.fuzz :class: lisa.fuzz.Int Draw a random int fitting within the ``[min_, max_]`` range. * - :class:`~lisa.fuzz.Set` - .. withrefctx:: :module: lisa.fuzz :class: lisa.fuzz.Set Same as :class:`lisa.fuzz.Choices` but returns a set. * - :class:`~lisa.fuzz.Shuffle` - .. withrefctx:: :module: lisa.fuzz :class: lisa.fuzz.Shuffle Randomly shuffle the given sequence. * - :class:`~lisa.fuzz.SortedList` - .. withrefctx:: :module: lisa.fuzz :class: lisa.fuzz.SortedList Same as :class:`lisa.fuzz.Choices` but returns a sorted list. * - :class:`~lisa.fuzz.Tuple` - .. withrefctx:: :module: lisa.fuzz :class: lisa.fuzz.Tuple Same as :class:`lisa.fuzz.Choices` but returns a tuple. .. rubric:: Functions .. list-table:: :align: left * - :func:`~lisa.fuzz.retry_until` - .. withrefctx:: :module: lisa.fuzz Returns an awaitable that will signify to the :class:`lisa.fuzz.Gen` monad to retry the computation until ``cond`` is ``True``. This is used to enforce arbitrary constraints on generated data. .. rubric:: Exceptions .. list-table:: :align: left * - :class:`~lisa.fuzz.RetryException` - .. withrefctx:: :module: lisa.fuzz :class: lisa.fuzz.RetryException Exception raised to signify to :class:`lisa.fuzz.Gen` to retry the random draw.