Skip to content

Commit 33d5011

Browse files
author
github-actions
committed
Add comprehensive Hypothesis property-based and stateful tests
- Add tests/strategies.py with 20+ reusable address generation strategies - Add tests/conftest.py with Hypothesis profile configuration - Add tests/test_hypothesis_properties.py with 39 property tests covering: - AddressFormatter idempotence and component extraction - ZipCodeNormalizer validation and normalization - AddressBuilder value preservation and fluent API - Address and ParseResult model invariants - AddressService parse consistency - Add tests/test_hypothesis_stateful.py with 4 stateful tests: - AddressBuilderStateMachine for fluent API testing - AddressServiceStateMachine for parse/validate cycles - AddressParseRoundtripStateMachine for roundtrip consistency - ZipPlusFourBuilderStateMachine for ZIP+4 handling Test suite expanded from 174 to 217 tests, coverage improved from 62% to 64%
1 parent 4fea67f commit 33d5011

File tree

4 files changed

+1609
-0
lines changed

4 files changed

+1609
-0
lines changed

tests/conftest.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
"""Shared pytest fixtures and Hypothesis configuration.
2+
3+
This module provides pytest fixtures and configures Hypothesis profiles
4+
for the test suite.
5+
"""
6+
7+
from __future__ import annotations
8+
9+
from hypothesis import Verbosity, settings
10+
11+
# Configure Hypothesis settings for the test suite
12+
settings.register_profile("ci", max_examples=200, deadline=None)
13+
settings.register_profile("dev", max_examples=50, deadline=None)
14+
settings.register_profile("debug", max_examples=10, deadline=None, verbosity=Verbosity.verbose)

0 commit comments

Comments
 (0)