0.4.0
New: replay_all(statuses={...}). Loops only recordings of the given statuses, so one loop can be exhaustive about success bodies and another about failure handling, with assertions specific to each.
def test_parses_every_recorded_success():
for attempt in stubsmith.replay_all(statuses={200}):
with attempt:
result = connector.sync_orders()
assert result.orders is not None
def test_degrades_on_every_recorded_failure():
for attempt in stubsmith.replay_all(statuses={429, 500}):
with attempt:
with pytest.raises((RateLimited, UpstreamUnavailable)):
connector.sync_orders()Filtering decides what a red build means. Unfiltered, the loop feeds successes and failures into one test body, so the day a 5xx first enters the recorded window, assertions written when only 200s existed start failing and the build breaks because the recording changed rather than because the code did. Filtered, a failure means your code cannot handle a response your API genuinely returns. It also bounds the pass count, otherwise roughly (samples per response) × (distinct statuses), which grows with traffic on its own.
A shape with recordings but none of the requested status raises StubNotFound, naming the filter and listing the statuses it does have, rather than substituting a response the loop was told to exclude.
stubsmith pull --endpoint can be repeated. --samples above 1 needs an endpoint, so covering several endpoints previously meant one pull each and merging the files by hand. Each endpoint is now one request and the responses are merged, deduplicating request shapes and carrying truncated through.
Corrected: the background threads are not named at the OS level. The docs said they were "identifiable in a thread dump", which sent a reader to /proc/<pid>/task/*/comm, where CPython shows python for both because it does not set the native thread name from Thread(name=...). The names are visible through threading.enumerate(); is_installed() is the supported way to check that capture is armed.
Additive: an unfiltered replay_all() and a single --endpoint behave exactly as in 0.3.0, so upgrading asks nothing of you.
Published to PyPI as stubsmith 0.4.0.