Skip to content
This is a simple example to show how to use Hypothesis
Python Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
.travis.yml
Makefile
README.md
example.py
example_tests.py
requirements.txt

README.md

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

You can’t perform that action at this time.