Closed ghost closed 1 year ago
Use vcr_config
@pytest.fixture(scope="module")
def vcr_config():
return {
"filter_headers": [
"Authorization"
]
}
Indeed, the vcr_config
fixture should be used for this purpose
Indeed, the
vcr_config
fixture should be used for this purpose
The before_record_response
option in vcr_config
? How and why would it behave differently than when passed to the decorator?
One of my cassettes makes a call to an authorization endpoint and therefore has sensitive data (
access_token
, etc) in the response body. Is there a way to filter the sensitive data from the response body, similar to thebefore_record_response
function in vcr.py? I tried calling that function from my code but it didn't work:@pytest.mark.vcr(before_record_response=lambda r: None)
.