Skip to main content

Pythonic library for QuickCheck-style randomized testing and SmallCheck-style exhaustive testing of the same test suite.

Project description

A library for property-based testing in two different ways:

  1. “QuickCheck” - randomly generated inputs

  2. “SmallCheck” - exhaustively enumerated inputs

These testing approaches are named for the pioneering Haskell libraries. The two approaches truly shine when used together - once a property is found to be refutable by some probably-huge-and-crazy random input, it is often worth investing the CPU time to find the _smallest_ counterexample.

This library is a brand new work-in-progress (see commit log for dates) with known issues:

  • Does not have randomly generated strings just yet.

  • No existential quantification yet, but smallcheck does allow it!

  • Needs more thorough testing.

  • Needs to be able to test that a property always throws an exception.

  • Needs lots more combinators.

  • Needs one-liner interface rather than checking status of test cases.

Installation & Usage

(TODO: Describe in more detail. For now, read doublecheck/gen.py and doublecheck/prop.py)

$ pip install doublecheck $ python >>> from doublecheck import * >>> ForAll(lambda i: i > 0, PosInts()).quickcheck(100000).status ‘Certain’

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

File details

Details for the file doublecheck-0.1pre2012-05-08T10-01-13.tar.gz.

File metadata

File hashes

Hashes for doublecheck-0.1pre2012-05-08T10-01-13.tar.gz
Algorithm Hash digest
SHA256 3317173e8d297d327bdff268e3b78c5ffb791d66dea3569abed25ff25765306c
MD5 53f8dd3e7006a84c11a763480aa93f9d
BLAKE2b-256 0877c4a44bd4322e0df6bd5cf313c22d9dee9cfa7068626dc12706b3f0000972

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page