Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Using `once` record_mode gives error

See original GitHub issue


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)>) 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

def test_vcr():
    response = requests.get("")
    assert response.status_code == 200


Click to expand!
../../Library/Caches/pypoetry/virtualenvs/featuredproductsswitch-q2O7GQgj-py3.8/lib/python3.8/site-packages/requests/ in get
    return request('get', url, params=params, **kwargs)
../../Library/Caches/pypoetry/virtualenvs/featuredproductsswitch-q2O7GQgj-py3.8/lib/python3.8/site-packages/requests/ in request
    return session.request(method=method, url=url, **kwargs)
../../Library/Caches/pypoetry/virtualenvs/featuredproductsswitch-q2O7GQgj-py3.8/lib/python3.8/site-packages/requests/ in request
    resp = self.send(prep, **send_kwargs)
../../Library/Caches/pypoetry/virtualenvs/featuredproductsswitch-q2O7GQgj-py3.8/lib/python3.8/site-packages/requests/ in send
    r = adapter.send(request, **kwargs)
../../Library/Caches/pypoetry/virtualenvs/featuredproductsswitch-q2O7GQgj-py3.8/lib/python3.8/site-packages/requests/ in send
    resp = conn.urlopen(
../../Library/Caches/pypoetry/virtualenvs/featuredproductsswitch-q2O7GQgj-py3.8/lib/python3.8/site-packages/urllib3/ in urlopen
    httplib_response = self._make_request(
../../Library/Caches/pypoetry/virtualenvs/featuredproductsswitch-q2O7GQgj-py3.8/lib/python3.8/site-packages/urllib3/ in _make_request
    httplib_response = conn.getresponse(buffering=True)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7

github_iconTop GitHub Comments

paxcodescommented, Jun 13, 2020

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 wrote:

The problem is, that record_mode passed in the vcr mark is not passed to VCR. I’ll fix that

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe .

paxcodescommented, Jun 15, 2020

Works perfectly. Thanks once again @Stranger6667!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found