Mercurial > public > mercurial-scm > hg-stable
diff tests/hghave.py @ 26842:0f76c64f5cc3
testing: add hypothesis fuzz testing
Hypothesis a library for adding fuzzing over a range of structure
data to your test suite: http://hypothesis.readthedocs.org/en/latest/
This adds the ability to build tests using Hypothesis within the Mercurial test
suite. New tests and fixes using this helpers comes in later changesets.
author | David R. MacIver <david@drmaciver.com> |
---|---|
date | Sat, 24 Oct 2015 12:46:03 +0100 |
parents | ca9bb66c80e9 |
children | a636a46f5094 |
line wrap: on
line diff
--- a/tests/hghave.py Mon Nov 02 13:00:45 2015 +0000 +++ b/tests/hghave.py Sat Oct 24 12:46:03 2015 +0100 @@ -463,3 +463,12 @@ @check("slow", "allow slow tests") def has_slow(): return os.environ.get('HGTEST_SLOW') == 'slow' + +@check("hypothesis", "is Hypothesis installed") +def has_hypothesis(): + try: + import hypothesis + hypothesis.given + return True + except ImportError: + return False