property-based-testing
Installation
SKILL.md
Property-Based Testing
Use Hypothesis to find edge cases automatically. Includes custom strategies for financial data, API responses, and stateful testing.
Core Patterns
from hypothesis import given, strategies as st, settings, assume
import hypothesis.extra.numpy as npst
# Basic property test
@given(st.lists(st.integers()))
def test_sort_is_idempotent(xs):
assert sorted(sorted(xs)) == sorted(xs)