Skip to content

Property-Based Utility Testsโš“๏ธŽ

Overviewโš“๏ธŽ

tests/test_property_based.py uses Hypothesis for property-based validation of the utility helpers in ezpz.utils. The suite runs only when both ezpz.utils and Hypothesis are available and skips otherwise, making it safe for constrained environments.

Highlightsโš“๏ธŽ

  • Idempotent normalisation โ€“ Repeated calls to utils.normalize must return the same value for any input string.
  • Lowercase guarantee โ€“ Normalised identifiers are forced to lowercase while preserving valid characters.
  • Identifier validity โ€“ Ensures the output contains only alphanumeric characters or dashes.
  • Formatted pairs โ€“ Confirms utils.format_pair produces stable string representations for floats with the requested precision.

Running the Testsโš“๏ธŽ

python -m pytest tests/test_property_based.py

Tip: Install Hypothesis via pip install hypothesis if it is not already present in your development environment.