These links might be of interest to Edward and others developing Python 
code, including Leo. 

First, a praise of property-based testing 
<https://increment.com/testing/in-praise-of-property-based-testing/>, with 
examples that differentiate it from example-based testing. 

Second, Hypothesis, «a Python library for creating unit tests which are 
simpler to write and more powerful when run, finding edge cases in your 
code you wouldn’t have thought to look for. It is stable, powerful and easy 
to add to any existing test suite.

It works by letting you write tests that assert that something should be 
true for every case, not just the ones you happen to think of.»

Third, Pydantic, «Data validation and settings management using python type 
annotations. *pydantic* enforces type hints at runtime, and provides user 
friendly errors when data is invalid. Define how data should be in pure, 
canonical python; validate it with *pydantic*.» This includes support for 
"custom" (user-defined) types. Pydantic uses type hinting from Versions 3.6 
and later of Python. 

A plug-in for Pydantic supports Hypothesis. Used together, Pydantic 1.8 and 
Hypothesis v5.29.0 allow Hypothesis to automatically load support for 
custom types like PaymentCardNumber (a credit-card number) and 
PositiveFloat. Current releases are Pydantic 1.8.1 and Hypothesis 6.10.0. 

Documentation for Hypothesis on Read the Docs 
<https://hypothesis.readthedocs.io/en/latest/>
Hypothesis on PyPi <https://pypi.org/project/hypothesis/>
Installing Hypothesis from source 
<https://github.com/HypothesisWorks/hypothesis/blob/master/CONTRIBUTING.rst>

Documentation for Pydantic on Help Manual 
<https://pydantic-docs.helpmanual.io>
Documentation for Pydantic's Hypothesis plug-in 
<https://pydantic-docs.helpmanual.io/hypothesis_plugin/>
Pydantic on PyPi <https://pypi.org/project/pydantic/>
Pydantic on GitHub <https://github.com/samuelcolvin/pydantic>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/ccc7c57a-0b17-4f7f-85a6-edfd04b61bd6n%40googlegroups.com.

Reply via email to