Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option allow_playback_repeats doesn't work on record #878

Open
pyoor opened this issue Nov 6, 2024 · 0 comments
Open

Option allow_playback_repeats doesn't work on record #878

pyoor opened this issue Nov 6, 2024 · 0 comments

Comments

@pyoor
Copy link

pyoor commented Nov 6, 2024

It appears that the allow_playback_repeats option doesn't work on record (though I'm not sure if that was intended).

The following test will record two requests when first creating the cassette.

def test_multiple_requests():
    with vcr.use_cassette('cassettes/cassette.yaml', allow_playback_repeats=True) as cass:
        response1 = requests.get("http://example.com")
        response2 = requests.get("http://example.com")

        assert response1.status_code == 200
        assert response2.status_code == 200

This could be fixed by modifying the following:

return request and request in self and self.record_mode != RecordMode.ALL and self.rewound

To something like:

return request and request in self and self.record_mode != RecordMode.ALL and (self.rewound or self.allow_playback_repeats)
@pyoor pyoor changed the title Option allow_playback_repeat doesn't work on record Option `allow_playback_repeats doesn't work on record Nov 6, 2024
@pyoor pyoor changed the title Option `allow_playback_repeats doesn't work on record Option allow_playback_repeats doesn't work on record Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant