Repository navigation
chore(deps): update dependency vcrpy to v9 - #2422
Open
renovate[bot] wants to merge 1 commit into
Open
renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
Contributor
Author
|
renovate
Bot
force-pushed
the
renovate/vcrpy-9.x
branch
from
November 6, 2026 09:54
6e057b3 to
8b9b90f
Compare
|
renovate
Bot
force-pushed
the
renovate/vcrpy-9.x
branch
3 times, most recently
from
November 6, 2026 16:01
05d0fb4 to
7d4f367
Compare
renovate
Bot
force-pushed
the
renovate/vcrpy-9.x
branch
from
November 6, 2026 17:14
7d4f367 to
ab9696b
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
>=7,<9→>=9,<10Release Notes
kevin1024/vcrpy (vcrpy)
v9.4.2Compare Source
What's Changed
block=True, e.g. a requests session withHTTPAdapter(pool_block=True), waiting forever for a free connection in a cassette, or when used before, after or across cassettes. A response now returns its connection to the pool once its body has been read, as in urllib3, and vcrpy keeps a pool's free slots when it takes connections out of it as a cassette starts or stops using the pool. A response finished after its cassette has exited gives back only the slot, not the cassette's connection (#949, #1094) - thanks @nk-batman21Full Changelog: kevin1024/vcrpy@v9.4.1...v9.4.2
v9.4.1Compare Source
What's Changed
ImportError: cannot import name 'HTTPHeaderDict'on urllib3 1.x, such as the 1.26 that Debian oldstable ships. The urllib3 stub importedHTTPHeaderDictfrom the top level ofurllib3, which only exports it from 2.0 on, souse_cassette()raised while building its patchers and nothing could be recorded (#1092, #1093) - thanks @inchang-ingFull Changelog: kevin1024/vcrpy@v9.4.0...v9.4.1
v9.4.0Compare Source
What's Changed
SOCKS proxies
Requests made through SOCKS proxies with requests and urllib3 (
socks5://andsocks5h://, with PySocks installed) are now recorded and played back. urllib3 uses its own connection classes for them, which vcrpy didn't patch, so these requests skipped the cassette entirely (#547, #548, #1087).Multipart form filtering
filter_post_data_parametersnow filters the fields ofmultipart/form-datarequest bodies, e.g.requests.post(url, data={"api_key": ...}, files=...). Before, it treated them as urlencoded forms and didn't find their fields, so their values were recorded (#521, #1090).If you match on
body: requests are filtered before they're matched, so cassettes recorded with unfiltered multipart bodies need re-recording.Fixes
CannotOverwriteExistingCassetteException, when avcr.patch.force_reset()window opened elsewhere is closed late by the garbage collector while the cassette is in use (#979, #1051, #1088) - thanks @yeion7, from #1052AttributeError: 'str' object has no attribute 'get_all'when requests builds a response from aurllib.requestresponse, e.g. withHTTPAdapter.build_response()(#956, #1089)Full Changelog: kevin1024/vcrpy@v9.3.2...v9.4.0
v9.3.2Compare Source
What's Changed
new_episodesrecord mode. urllib3 connects before sending a request, before vcrpy knows whether it will be played back, so every such request made a TLS handshake, and failed without network access (#515, #1086)TypeErrorwhenuse_cassette()without a path is used as a context manager, instead ofKeyError: 'path'. A path can be left out only when decorating a function (#570)filter_post_data_parameterscrashing withAttributeErroron iterator request bodies, e.g. a generator passed asdata. Like file bodies, they're left unfiltered (#814)inject_cassette, which passes the cassette to a decorated function, e.g. to rewind it or make assertions (#207, #493)Full Changelog: kevin1024/vcrpy@v9.3.1...v9.3.2
v9.3.1Compare Source
What's Changed
Requestcan be imported fromvcr, e.g.vcr.Request("GET", uri, body, headers), as the docs already called it (#759) - thanks @lewisdawsonFull Changelog: kevin1024/vcrpy@v9.3.0...v9.3.1
v9.3.0Compare Source
What's Changed
New features
Cassette metadata (#934, thanks @hasier): store values that aren't part of an interaction, such as a seed for random IDs a test sends, so they're the same when a cassette is recorded and played back.
The cassette stores
defaultthe first time and returns the stored value after that. If the record mode doesn't allow changing the cassette, a missing key raisesMissingMetadataError, aCannotOverwriteExistingCassetteException. See the docs.skip_patchers(#944, #1070, thanks @smoltafet): leave some HTTP libraries unpatched. For example,skip_patchers=["httpx"]stops an httpx client with an aiohttp transport (httpx-aiohttp) from being recorded twice.filter_nested_post_data_parameters(#936, #937, thanks @tighwm and @JargeZ): makefilter_post_data_parametersalso filter keys in nested objects of JSON request bodies, such as JSON-RPCparams. It's opt-in, so existing setups don't filter more than before.ignore_hostsaccepts compiled regular expressions (#779, thanks @silviumarcu), which match whole host names:ignore_hosts=["example.com", re.compile(r".*\.actions\.githubusercontent\.com")].allow_playback_repeatsalso applies while recording (#878, #879, thanks @pyoor): a request that matches one already recorded gets the recorded response, instead of being sent and recorded again. When played back, such requests got the first response anyway.Fixes
TypeErrororJSONDecodeError(#579, #1081, thanks @nk-batman21)ignore_localhostorignore_hosts, no longer have their response body read by vcrpy, so they stream as usual (#978, thanks @AronsonDan)release_conn()on a streamed response returns its connection to the pool (#1084, thanks @edsonsims)drop_unused_requestsno longer saves an interaction once per playback whenallow_playback_repeatsis setDocs and CI
before_record_responsealso runs when a cassette is loaded, so it should be idempotent (#1042, #1044, thanks @ciastek)urllib.requestinstead of Python 2'surllib2(#998, thanks @TejasAmle)Full Changelog: kevin1024/vcrpy@v9.2.0...v9.3.0
v9.2.0Compare Source
What's Changed
Keep secrets out of cassettes with
filter_sensitive_dataEvery occurrence of the value in a recorded interaction, in the URL, headers and request and response bodies, is replaced with the placeholder when the cassette is saved, and put back when it's loaded. So:
<API_KEY>,Values can also be functions of the interaction. See the docs for using it in CI without the real secret, and for values that are encoded differently in different places. Modeled on Ruby VCR's option of the same name.
Save and load hooks
before_save_interactionandafter_load_interactionget each interaction's request and response, plus the cassette if they take a third argument, when a cassette is saved and loaded. They return them, changed or not, orNoneto leave the interaction out. Unlikebefore_record_requestandbefore_record_response, they run exactly once per interaction. Some uses, from issues:See the docs for examples. They're modeled on Ruby VCR's
before_recordandbefore_playbackhooks, andfilter_sensitive_datais built on them. Thanks to the authors of #679 and #594, which explored this.Cassettes also have a new read-only
pathproperty.Full Changelog: kevin1024/vcrpy@v9.1.0...v9.2.0
v9.1.0Compare Source
What's Changed
Fixes
raw_headers, so code that reads them (e.g. httpx-aiohttp) works on replay (#970, #1034). Thanks @HostX0release_conn(), for code that releases pooled responses (#816, #1054). Thanks @cristianchiriacpathlib.Pathand other path-like objects work for cassette paths andcassette_library_dir(#567, #920, #1064). Thanks @fredrikblaufilter_post_data_parametersmatches urlencoded parameter names, so e.g.api:keyalso filtersapi%3Akey(#686, #1066). Thanks @b84330808bodymatcher no longer crashes on form-urlencoded and XML-RPC requests without a body (#913, #1032). Thanks @M001Nignore_localhostalso ignores::1(#639). Thanks @dragonpaw for the reportNew
json(), as urllib3 2.x responses do (#774). Thanks @gschnellOnera for the reportuse_cassetteaccepts apersisteroption, to use a custom persister for one cassette (#575). Thanks @gioele for the reportReleases
Full Changelog: kevin1024/vcrpy@v9.0.0...v9.1.0
v9.0.0Compare Source
Upgrading from 8.x
9.0.0 has five changes that can affect existing test suites:
CannotOverwriteExistingCassetteExceptionmessage. If your code or tests match on the message text (e.g."Can't overwrite existing cassette"), update them. The exception class and itscassetteandfailed_requestattributes are unchanged, and a newreasonattribute ("cassette_not_found","already_played","no_match"or"nothing_similar") is a sturdier thing to check (#1076).filter_post_data_parametersnow filters request bodies for every HTTP method, not justPOST(#328, #1004). Requests are filtered before they're matched, so if you match onbody, re-record cassettes that have unfilteredPUT/PATCH/DELETEbodies.vcr.filters.replace_post_data_parametersitself still only filtersPOST; use the newreplace_body_parametersfor any method.raise_for_statusis used (on the session or the request), and replaying them raises like aiohttp does (#635, #925). Before, they weren't recorded, and a replayed error response didn't raise.HTTPHeaderDictheaders, as they do without vcrpy, instead of anHTTPMessage(#841, #1015).What's Changed
Much better errors when a request isn't in the cassette
The
CannotOverwriteExistingCassetteExceptionmessage now says what actually went wrong, shows how the closest recorded requests differ, and suggests how to fix it (#1076). It fixes:For example:
Thanks @philsong4-ai (#1027) and @ChrisJr404 (#1037) for the PRs that started this.
Fixes
raise_for_statusis used (#635, #925). Thanks @andrescollaresfilter_post_data_parametersfilters request bodies for every HTTP method (#328, #1004). Thanks @andrescollaresLinkheaders) keep every value in urllib3 and requests responses (#947, #1015). Thanks @Sanjays2402bodymatcher no longer crashes when a body doesn't parse as its headers say, e.g. invalid JSON sent asapplication/json(#1075)Python support
Full Changelog: kevin1024/vcrpy@v8.5.0...v9.0.0
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.