Skip to content
Hypothesis is a powerful, flexible, and easy to use library for property-based testing.
Python Jupyter Notebook Rust Ruby TeX Shell Other
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
brand Add exact sticker image with "Hypothesis" Dec 15, 2019
conjecture-rust Bump conjecture-rust version to 0.4.0 and update changelog Oct 24, 2018
guides Improve docstrings and docs formatting Jan 12, 2020
hypothesis-python Bump hypothesis-python version to 5.2.0 and update changelog Jan 19, 2020
hypothesis-ruby Format docs using `blacken-docs` Oct 14, 2019
notebooks Final table Jun 27, 2015
requirements Update pinned dependencies Jan 10, 2020
scripts Delete Python2-only tests Dec 30, 2019
tooling Remove midnight release helper Jan 12, 2020
whole-repo-tests Strip out __future__ imports Jan 1, 2020
.flake8 Compat cleanup in other modules Jan 6, 2020
.gitattributes Preclude .jpg, .png, .gif being rewritten on git push Jun 25, 2019
.gitignore Ignore vscode temp files Feb 2, 2019
.isort.cfg Use Py3+ autoformat configs Jan 1, 2020
.pyup.yml Fix auto-update system Aug 13, 2019
.readthedocs.yml Use same Sphinx version as CI Jan 12, 2020
.travis.yml Remove rust tests from travis Dec 16, 2019
CITATION Update CITATION Nov 25, 2019
CODEOWNERS Clarify wording from review Nov 18, 2019
CODE_OF_CONDUCT.rst The code of conduct is not just for the Python community Apr 11, 2018
CONTRIBUTING.rst Fix `is_hypothesis_file` internal function Jan 11, 2020
LICENSE.txt Use https:// URLs in docs and comments where available Jan 8, 2019
Makefile Fix typo Apr 21, 2018
README.rst Add missing word in README.rst Nov 25, 2019
azure-pipelines.yml Windows CI can use two cores Jan 6, 2020
build.sh Attempt to unbreak build by using latest pip and pip-tools Oct 14, 2019
mypy.ini Use more precise type annotations Jan 10, 2020
paper.bib fixing missing letter Nov 21, 2019
paper.md Improve wording of paper Nov 20, 2019
pytest.ini Change top level build system to custom runner Apr 21, 2018
secrets.tar.enc Update secrets for cargo Jun 23, 2018

README.rst

Hypothesis

Hypothesis is a family of testing libraries which let you write tests parametrized by a source of examples. A Hypothesis implementation then generates simple and comprehensible examples that make your tests fail. This simplifies writing your tests and makes them more powerful at the same time, by letting software automate the boring bits and do them to a higher standard than a human would, freeing you to focus on the higher level test logic.

This sort of testing is often called "property-based testing", and the most widely known implementation of the concept is the Haskell library QuickCheck, but Hypothesis differs significantly from QuickCheck and is designed to fit idiomatically and easily into existing styles of testing that you are used to, with absolutely no familiarity with Haskell or functional programming needed.

Hypothesis for Python is the original implementation, and the only one that is currently fully production ready and actively maintained.

Hypothesis for Other Languages

The core ideas of Hypothesis are language agnostic and in principle it is suitable for any language. We are interested in developing and supporting implementations for a wide variety of languages, but currently lack the resources to do so, so our porting efforts are mostly prototypes.

The two prototype implementations of Hypothesis for other languages are:

  • Hypothesis for Ruby is a reasonable start on a port of Hypothesis to Ruby. It worked pretty well, but uses a core Rust implementation that is unfortunately not compatible with recent versions of Rust, due to its dependency on Helix (which now seems to be mostly unmaintained) and as a result is currently unsupported pending a rewrite of the bridging code between Rust and Ruby. We don't at present have the time or funding for this project, but it is likely not a massive undertaking if anyone would like to provide either of these.
  • Hypothesis for Java is a prototype written some time ago. It's far from feature complete and is not under active development, but was intended to prove the viability of the concept.

Additionally there is a port of the core engine of Hypothesis, Conjecture, to Rust. It is not feature complete but in the long run we are hoping to move much of the existing functionality to Rust and rebuild Hypothesis for Python on top of it, greatly lowering the porting effort to other languages.

Any or all of these could be turned into full fledged implementations with relatively little effort (no more than a few months of full time work), but as well as the initial work this would require someone prepared to provide or fund ongoing maintenance efforts for them in order to be viable.

You can’t perform that action at this time.