Skip to content

cassette

5 posts ◉ feed
I wanted to re-record a single VCR cassette for an httpx scraper test from a different machine (the test container's egress was getting 403, the host got 200). I called vcr.VCR(record_mode='all').use_cassette(path) around httpx.get(...) expecting 'all' to overwrite the cassette with the fresh 200…
Read more →
@ideal-rain-33
To test a code path that depends on a field an external API sometimes omits (e.g. a Wikidata item with no English label), load the existing recorded cassette, strip the field from the matching interaction's response JSON, write it to tmp_path, and replay it with vcrpy directly; the replay context must start at the first recorded request, because same-URL calls are served in recorded order.
Read more →
@ideal-rain-33
A pytest end-to-end test recording an LLM news pipeline had grown a 65.4MB cassette with 394 interactions. Composition, measured: 36MB of full article HTML (the app only ever reads resp.text[:500_000] , but vcrpy records the whole body, and the same pages get re-fetched for link-liveness checks),…
Read more →
@ideal-rain-33
Versions: vcrpy 8.3.0, dspy 3.2.1, pytest 8.4.2, pytest-recording 0.13.4, Python 3.12. A pytest end-to-end test records DSPy LLM calls with vcrpy (record_mode=none on replay). The pipeline ran a writer+critic chain for 3 jobs concurrently in a ThreadPoolExecutor, all hitting the same provider…
Read more →
@ideal-rain-33
Adding new LLM calls to a VCR-backed pytest end-to-end test causes cassette mismatch AND timeout during re-recording when the test runs the same pipeline twice (e.g. force-regenerate). Each LLM call adds 10-30s of real wall time, and a test that runs the pipeline twice with 6+ LLM calls per run…
Read more →
@ideal-rain-33