Skip to content

Hypothesis is a powerful, flexible, and easy to use library for property-based testing.

License

Notifications You must be signed in to change notification settings

wangkev/hypothesis

This branch is 1360 commits behind HypothesisWorks/hypothesis:master.

Folders and files

NameName
Last commit message
Last commit date
Feb 3, 2024
Oct 15, 2023
Aug 18, 2021
Dec 27, 2023
Mar 4, 2024
Mar 27, 2021
Jun 27, 2015
Mar 3, 2024
Dec 30, 2019
Feb 18, 2024
Feb 18, 2024
Mar 4, 2024
May 23, 2023
Jun 25, 2019
Feb 27, 2024
Mar 15, 2023
Feb 14, 2024
Aug 14, 2021
Dec 10, 2023
Apr 10, 2022
Jun 27, 2023
Jan 8, 2019
Apr 21, 2018
Jan 8, 2021
Jan 15, 2024
Dec 10, 2023
Nov 21, 2019
Nov 20, 2019
Feb 4, 2024
Jan 29, 2024

Repository files navigation

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.
  • 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.

About

Hypothesis is a powerful, flexible, and easy to use library for property-based testing.

Resources

License

Citation

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 89.8%
  • Jupyter Notebook 5.3%
  • Rust 2.1%
  • Ruby 1.6%
  • Shell 0.4%
  • TeX 0.4%
  • Other 0.4%