/hypothesis-use-case

This is a simple example to show how to use Hypothesis

Primary LanguagePython

Hypothesis use case Travis Status

This is a simple example to show how to use Hyposthesis library to generates random data to your tests.

Install

    $ make install

Test

    $ make test

Just one unit test like this:

    @given(st.integers(), st.integers())
    def test_ints_sum(self, x, y):
        log.info('Testing {} plus {}'.format(x, y))

        assert x + y == sum_numbers(x, y)

Can be covered by many different inputs:

Tests