testable#
Property-based testing of the axioms with Hypothesis.
An Axiom is an equation stated once on an abstract base class of
discopy.abc and inherited by every category below it, where
Axiom.failing() and Axiom.inapplicable() classify it when a
category breaks it or has no such structure. A Testable category
generates its own objects and arrows, and states the laws every type that
does so obeys: a term reads back from its representation, its pickle and
its tree. The matrix in proptest/ checks every axiom of every
category against generated arguments, one cell per pair; CONTRIBUTING.md
says how to run it.
Summary#
An equation is a list of |
|
An axiom of a category, stated once on an abstract base class and inherited by every category below it. |
|
A law declared broken, raised when the bound axiom is called: the reason is the message and |
|
A type that comes with a search strategy generating its instances, and the laws every such type obeys: a term reads back from its representation, its pickle and its tree. |
|
A rectangular grid with composable rows and columns. |
|
Two morphisms composable from left to right. |
|
Three values composable from left to right. |
Functions
Decorate an equation as a categorical axiom: a classmethod of its category, implicitly, whose remaining parameters are generated. |
|
Resolve the strategy implemented by an annotated type. |
|
Replace the |
|
Check every axiom of each category on a single generated example, a dry run of the property tests in |