[Bug] Using `once` record_mode gives error
See original GitHub issueProblem
Using once
gives an error:
vcr.errors.CannotOverwriteExistingCassetteException: Can't overwrite existing cassette ([PATH_OF_CASETTE_FILE]) in your current record mode ('once').
E No match for the request (<Request (GET) https://postman-echo.com/get?foo1=bar1&foo2=bar2>) was found.
E No similar requests, that have not been played, found.
I ran this the first time so PATH_OF_CASETTE_FILE shouldn’t exist although the error seems to say it exists. I checked the PATH_OF_CASETTE_FILE that the error specifies before I run my test the 2nd time and indeed no such file exists.
To Reproduce
import pytest
import requests
@pytest.mark.vcr(record_mode="once")
def test_vcr():
response = requests.get("https://postman-echo.com/get?foo1=bar1&foo2=bar2")
assert response.status_code == 200
Stacktrace
Click to expand!
../../Library/Caches/pypoetry/virtualenvs/featuredproductsswitch-q2O7GQgj-py3.8/lib/python3.8/site-packages/requests/api.py:76: in get
return request('get', url, params=params, **kwargs)
../../Library/Caches/pypoetry/virtualenvs/featuredproductsswitch-q2O7GQgj-py3.8/lib/python3.8/site-packages/requests/api.py:61: in request
return session.request(method=method, url=url, **kwargs)
../../Library/Caches/pypoetry/virtualenvs/featuredproductsswitch-q2O7GQgj-py3.8/lib/python3.8/site-packages/requests/sessions.py:530: in request
resp = self.send(prep, **send_kwargs)
../../Library/Caches/pypoetry/virtualenvs/featuredproductsswitch-q2O7GQgj-py3.8/lib/python3.8/site-packages/requests/sessions.py:643: in send
r = adapter.send(request, **kwargs)
../../Library/Caches/pypoetry/virtualenvs/featuredproductsswitch-q2O7GQgj-py3.8/lib/python3.8/site-packages/requests/adapters.py:439: in send
resp = conn.urlopen(
../../Library/Caches/pypoetry/virtualenvs/featuredproductsswitch-q2O7GQgj-py3.8/lib/python3.8/site-packages/urllib3/connectionpool.py:670: in urlopen
httplib_response = self._make_request(
../../Library/Caches/pypoetry/virtualenvs/featuredproductsswitch-q2O7GQgj-py3.8/lib/python3.8/site-packages/urllib3/connectionpool.py:417: in _make_request
httplib_response = conn.getresponse(buffering=True)
Issue Analytics
- State:
- Created 3 years ago
- Comments:7
Top Results From Across the Web
Netsuite bug when creating customerdeposit record
After a reply on the Netsuite user group prompted me to use the {recordmode:'dynamic'} attributes I am getting a strange error.
Read more >Solved: Why is nothing showing up in record mode? - 9471644
Solved: Hi! Just upgraded to the new full-fledged version, and although I can see my puppet in 'rig' mode, I'm suddenly getting a...
Read more >Screenshot Overlay Doesn't Go Away - Apple Community
When I take a screenshot (Command+Shift+5), the area selector appears, I make the necessary selection adjustment, then click Return.
Read more >0RECORDMODE field values updated incorrectly
Dear All, we have and issue with 0recordmode field in the datasource 0FI_AP_4 , as per our analysis the field has other values...
Read more >Animation Window undo error in rec mode after preview offset
Getting an InvalidOperationException error after the following operations in the Animation window. This can be reproduced with a sin...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I believe it also does not work when I use the vcr_config fixture to set the record_mode to ‘once’
On Fri, Jun 12, 2020, 7:04 AM Dmitry Dygalo notifications@github.com wrote:
Works perfectly. Thanks once again @Stranger6667!