-
Notifications
You must be signed in to change notification settings - Fork 46
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
Betamax issues #194
Comments
Hmm, I don't really know, sorry. It's been a while since I made that change and I haven't been closely involved in this project for quite some time |
@jarhill0 No big deal, I just thought you might have an idea here why the replacement logic seems to act wrong. Thanks for your answer anyway. |
I was getting some errors ( My solution was quite simple — I added this piece into every test which needed recording a cassette: import requests
self.gc._session.cookies.set_cookie(
requests.cookies.create_cookie(
name="gspkauth",
value="TOKEN_VALUE",
)
) Example: def test_something(self):
import requests
self.gc._session.cookies.set_cookie(
requests.cookies.create_cookie(
name="gspkauth",
value="TOKEN_VALUE",
)
)
with self.recorder.use_cassette("some_cassette"):
cache = self.gc._try_getting_cache_from_guid("cache_guid")
self.assertEqual("cache_name", cache.name) This is mostly a note for me, so I wouldn't need to find the workaround again 😄 |
I recently stumbled upon some strange issues which seem to be related to our Betamax setup. One issue is already documented in #186, although I am not sure why.
Additionally, #193 (comment) just unveiled that recording cassettes seems to fail if there is more than one method inside a test class. Example:
For me, recording the
test_quick_load
cassette failed whiletest_author
had existing cassettes, but was executed. Simply adding a comment totest_author
allowed me to record the cassette fortest_quick_load
. As soon as the cassettes are recorded, everything seems to work correctly.Command:
PYCACHING_TEST_USERNAME=USERNAME PYCACHING_TEST_PASSWORD=PASSWORD pytest test/test_cache.py::TestCacheIssues --verbose -rsx --log-cli-level=10
.Relevant excerpt from the output (logging
res.request.header
andres.text
beforeres.raise_for_status
inpycaching.geocaching.Geocaching._request
) - I have been surprised by the quite verbose output here as well:The text was updated successfully, but these errors were encountered: