mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-09 01:03:24 +00:00
Feat/2.1.0 release changelog documentation (#466)
* chore(changelog): add changelog for 2.1.0 release * doc(rewind): add documentation a new feature `rewind` that can replay a cassette * doc(exception): add documentation on the new behavior of the CannotOverwriteExistingCassetteException message
This commit is contained in:
@@ -372,3 +372,16 @@ cassette names, use ``VCR.ensure_suffix`` as follows:
|
||||
|
||||
@my_vcr.use_cassette
|
||||
def my_test_function():
|
||||
|
||||
Rewind Cassette
|
||||
---------------
|
||||
|
||||
VCR.py allows to rewind a cassette in order to replay it inside the same function/test.
|
||||
|
||||
.. code:: python
|
||||
|
||||
with vcr.use_cassette('fixtures/vcr_cassettes/synopsis.yaml') as cass:
|
||||
response = urllib2.urlopen('http://www.zombo.com/').read()
|
||||
assert cass.all_played
|
||||
a.rewind()
|
||||
assert not cass.all_played
|
||||
|
||||
@@ -1,7 +1,17 @@
|
||||
Changelog
|
||||
---------
|
||||
- 2.0.2 (UNRELEASED) - Drop support to python 3.4
|
||||
- 2.1.1 (UNRELEASED)
|
||||
- 2.1.0 - Add a `rewind` method to reset a cassette (thanks @khamidou)
|
||||
New error message with more details on why the cassette failed to play a request (thanks @arthurHamon2, @neozenith)
|
||||
Handle connect tunnel URI (thanks @jeking3)
|
||||
Add code coverage to the project (thanks @neozenith)
|
||||
Drop support to python 3.4
|
||||
Add deprecation warning on python 2.7, next major release will drop python 2.7 support
|
||||
Fix build problems on requests tests (thanks to @dunossauro)
|
||||
Fix matching on 'body' failing when Unicode symbols are present in them (thanks @valgur)
|
||||
Fix bugs on aiohttp integration (thanks @graingert, @steinnes, @stj, @lamenezes, @lmazuel)
|
||||
Fix Biopython incompatibility (thanks @rishab121)
|
||||
Fix Boto3 integration (thanks @1oglop1, @arthurHamon2)
|
||||
- 2.0.1 - Fix bug when using vcrpy with python 3.4
|
||||
- 2.0.0 - Support python 3.7 (fix httplib2 and urllib2, thanks @felixonmars)
|
||||
[#356] Fixes `before_record_response` so the original response isn't changed (thanks @kgraves)
|
||||
|
||||
@@ -29,3 +29,29 @@ The second time, you will see::
|
||||
If you set the loglevel to DEBUG, you will also get information about
|
||||
which matchers didn't match. This can help you with debugging custom
|
||||
matchers.
|
||||
|
||||
CannotOverwriteExistingCassetteException
|
||||
========================================
|
||||
|
||||
When a request failed to be found in an existing cassette,
|
||||
VCR.py tries to get the request(s) that may be similar to the one being searched.
|
||||
The goal is to see which matcher(s) failed and understand what part of the failed request may have changed.
|
||||
It can return multiple similar requests with :
|
||||
|
||||
- the matchers that have succeeded
|
||||
- the matchers that have failed
|
||||
- for each failed matchers, why it has failed with an assertion message
|
||||
|
||||
CannotOverwriteExistingCassetteException message example :
|
||||
|
||||
.. code:: python
|
||||
|
||||
CannotOverwriteExistingCassetteException: Can't overwrite existing cassette ('cassette.yaml') in your current record mode ('once').
|
||||
No match for the request (<Request (GET) https://www.googleapis.com/?alt=json&maxResults=200>) was found.
|
||||
Found 1 similar requests with 1 different matchers :
|
||||
|
||||
1 - (<Request (GET) https://www.googleapis.com/?alt=json&maxResults=500>).
|
||||
Matchers succeeded : ['method', 'scheme', 'host', 'port', 'path']
|
||||
Matchers failed :
|
||||
query - assertion failure :
|
||||
[('alt', 'json'), ('maxResults', '200')] != [('alt', 'json'), ('maxResults', '500')]
|
||||
Reference in New Issue
Block a user