icontract-hypothesis-vim

December 23, 2020 ยท View on GitHub

Icontract-hypothesis-vim is a Vim plug-in for icontract-hypothesis, a tool that integrates Hypothesis library for property-based testing with icontract library for design-by-contract in Python.

Animated GIF demonstrating the plug-in

Usage

Move the cursor to the function that you want to test or select a range of functions.

:IcontractHypothesisTest [settings ...]

Automatically infer the test strategy and execute it.

If {settings} are provided, they are passed to Hypothesis. The format of the settings is name=value.

Example:

:IcontractHypothesisTest max_examples=500

:IcontractHypothesisInspect

Infer the test strategy and display it.

No tests are executed.

Example:

:IcontractHypothesisInspect

Installation

Versioning

We follow Semantic Versioning. The version X.Y.Z indicates:

  • X is the major version (backward-incompatible),
  • Y is the minor version (backward-compatible), and
  • Z is the patch version (backward-compatible bug fix).