pyquchk - random and serial testing
pyquchk (abbreviated from Python QuickCheck) is the most comprehensive and extensible, altrough easy-to-use, random and serial testing framework. As you see from the name, it’s inspired by Haskell QuickCheck, but aims to provide much more capabilities.
Full documentation, including usage examples, is available at pythonhosted.org/pyquchk.
Features
Already implemented
pyquchk combines two approaches to the arguments values generation in a single framework:
QuickCheck-like (random)
Random (fuzzy) testing runs a function for many randomly generated arguments values to make sure it’s generally correct. Some features (both from the original QuickCheck and unique to pyquchk)
SmallCheck-like (serial)
Serial testing means that values are generated starting with some edge cases and small ones. This exhausts all possible values up to some “size” and is deterministic, in contrast to the random approach. Serial testing nicely complements the random one and so gives more confidence that the function tested is correct.
Other notable features include:
a lot of configurable built-in generators for different value types (see arbitraries for the list of currently implemented generators)
custom generators are supported, both for built-in types and user-created ones
easy-to-write and read syntax for simple property checking as well as for full tests to be run with a framework (nose or py.test for example)
pyquchk attempts to give you the smallest available counterexample, always performing shrinkg of the generated value (and if a value is found with serial testing, it’s probably already minimal)
assume function (allows so-called conditional properties and much more)
Easy creation of Arbitraries combinations
Examples: string from list; tuple with equally-sized strings.
Planned
pyquchk is in active development, and I have many features to implement here:
Option to check for exists, not for_all
Tests timing
Show time spent in pyquchk code and in tested function
Support generators arguments depending on other generators values
Something like forAll in original QuickCheck, but everything is to be defined as the function default arguments. Example: integer from the range [0:len(list)].
Size support
Generation function takes size parameter which increases (from 0 to 1?) from the first to the last test. Explore sized, resize and so on from QuickCheck - whether they will fit here.
Look for best way to express:
Modifiers like positive/negative/nonempty/…
Different numbers distributions like uniform/exponential/…
Structures like def f(a={int: [str_(...)]}, b=[float], c={'x': int, 'y': list})
Any use for Python 3 annotations?
Better testing pyquchk itself
Smart shrink from QuickCheck, SmartCheck
Collect, classify, cover
Not only boolean parameters (label/no label), but numerical as well. Example: difference between approximate function result and the exact one.
Verbosity settings
Print seed and allow to change it
Don’t fail fast
Add timeout
Release files for pyquchk 0.5.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyquchk-0.5.3.tar.gz | 14.7 kB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyquchk-0.5.3-py3.3.egg | Legacy Egg format | - | - | Details |
| pyquchk-0.5.3-py2.7.egg | Legacy Egg format | - | - | Details |
Total release size:105.1 kB
Release files / pyquchk-0.5.3.tar.gz
| Download URL | pyquchk-0.5.3.tar.gz |
|---|---|
| Size | 14.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0ae3fe9ed088de8cf6d3d43f2ee56196eb27fe4ba8e72d8a11367a362915eaa9
|
|
BLAKE2b-256 checksum How to use checksums |
fd046460d2eb38174f5e1470ed157932a951606ede87f81829ee6a98ce8de59a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pyquchk-0.5.3-py3.3.egg
| Download URL | pyquchk-0.5.3-py3.3.egg |
|---|---|
| Size | 46.5 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
9e9bc268b2ab37cf3a8c1f4bc8d7316c43f92a726cd989b6785711af7cc07d0c
|
|
BLAKE2b-256 checksum How to use checksums |
dd490f15c8d986747f1eaab1f3c7c8669fd25e354e60071a047b1248c459e261
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / pyquchk-0.5.3-py2.7.egg
| Download URL | pyquchk-0.5.3-py2.7.egg |
|---|---|
| Size | 43.9 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
5922c70cf170652c64febaacacb7f8ace5a58b129e154cb0748e9106467c9011
|
|
BLAKE2b-256 checksum How to use checksums |
73baa21c974fbf791dead19f1fb870e03252b64321da16d6a34d39bdc9d03eee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |