Daniel Silva
e3ced4385e
docs: update example in advanced.rst
...
Co-authored-by: Sebastian Pipping <sebastian@pipping.org >
2025-01-11 11:21:55 -05:00
Daniel Silva
d64cdd337b
style: fix formatting issues to comply with pre-commit hooks
2025-01-04 23:45:43 +00:00
Daniel Silva
36c7465cf7
docs: add drop_unused_requests option
2023-01-04 21:59:58 +00:00
Daniel Silva
010fa268d1
test: add tests to drop_unused_requests option
2023-01-04 20:09:31 +00:00
Daniel Silva
99c0384770
feat: add an option to exclude unused interactions
...
Introduce the `drop_unused_requests` option (False by default). If True, it will force the `Cassette` saving operation with only played old interactions and new ones if they exist. As a result, unused old requests are dropped.
Add `_old_interactions`, `_played_interactions` and `_new_interactions()`. The `_old_interactions` are previously recorded interactions loaded from Cassette files. The `_played_interactions` is a set of old interactions that were marked as played. A new interaction is a tuple (request, response) in `self.data` that is not in `_old_interactions` list.
2023-01-02 03:52:52 +00:00
Terseus
42d79b1102
Restore the pytest-httpbin package in tox.ini
...
The branch with the fix for HTTPS redirects is included in v1.0.1
See https://github.com/kevin1024/pytest-httpbin/releases/tag/v1.0.1
2022-11-01 09:08:59 -03:00
Jair Henrique
cef85a4986
remove pytest deprecation warning for yield_fixture
2022-10-31 22:44:26 -03:00
Terseus
964615af25
Include how to use record_on_exception in the docs
2022-10-31 22:43:03 -03:00
Terseus
3b6d79fc0b
Prevent Sphinx warning about language = None
...
Since version 5.x Sphinx triggers a warning when `language = None`, this
caused `tox -e docs` to fail.
Set it to "en".
See https://github.com/sphinx-doc/sphinx/pull/10481
2022-10-31 22:43:03 -03:00
Terseus
f48922ce09
Fix not calling all the exit stack when record_on_exception is False
...
The initial technique to implement `record_on_exception=False` was to
not emptying the generator returned by
`CassetteContextDecorator._patch_generator` when an exception happens to
skip the `cassette._save` call, however this had the side effect of not
emptying the `ExitStack` created inside the generator which contains the
`_patch.__exit__` calls to remove the patches.
This was innocuous in CPython, which uses a reference counting garbage
collector so the `ExitStack` was immediately collected after losing
scope and therefore its `__exit__` method executed.
Pypy, on the other hand, uses a generational garbage collector so its
objects may survive more time, enough for the `ExitStack` not called
until much later, which may cause the patches to live more than expected
when `record_on_exception=False`.
This was found because the test
`test_nesting_context_managers_by_checking_references_of_http_connection`
was failing because it was executed after
`test_dont_record_on_exception`.
Now the cassette instance is saved inside the `CassetteContextDecorator`
instance to have better control on where to save the cassette, and moved
the `cassette._save` call from the `_patch_generator` method to the
`__exit__` method to be free to empty the generator and remove the
patches always.
2022-10-31 22:43:03 -03:00
Terseus
2980bfccde
Fix lint errors
2022-10-31 22:43:03 -03:00
Dan Passaro
7599f4d50a
Fix Py3 tests using b'' literal
2022-10-31 22:43:03 -03:00
Dan Passaro
995020bf06
Add record_on_exception flag.
...
Defaults to True, which maintains historical behavior.
Fixes #205 .
2022-10-31 22:43:03 -03:00
Jair Henrique
423ccaa40b
Set fail-fast to false on CI
2022-10-31 22:18:30 -03:00
Josef
526fdbb194
Add Path handling to use_cassette and to filesystem.py persister
...
* now it is possible to use path from pathlib
2022-10-31 22:15:14 -03:00
Evgeni Golov
511d0ab855
add python 3.11 support
2022-10-31 09:00:35 -03:00
Jair Henrique
60ac99c907
Run lint on CI
2022-10-14 10:53:54 -03:00
dependabot[bot]
57dee93e11
build(deps): bump actions/checkout from 3.0.2 to 3.1.0
...
Bumps [actions/checkout](https://github.com/actions/checkout ) from 3.0.2 to 3.1.0.
- [Release notes](https://github.com/actions/checkout/releases )
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md )
- [Commits](https://github.com/actions/checkout/compare/v3.0.2...v3.1.0 )
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com >
2022-10-11 10:34:41 -03:00
Jair Henrique
0eece7f96e
Add isort to code lint
2022-10-09 11:35:37 -03:00
Chris Wesseling
eb59d871b4
Handles empty responses with gzip/deflate encoding.
...
Closes #661
2022-10-09 11:04:44 -03:00
Kevin McCarthy
f3f66086a1
Release v4.2.1
v4.2.1
2022-08-31 14:14:32 -05:00
Ville Skyttä
c3767c2fdb
fix(aiohttp): record body of first request in redirect chain
...
The first could be e.g. a POST with one, only the remaining ones are
expected to be GETs without one.
2022-08-31 14:11:55 -05:00
Joel Shprentz
6fff3ab952
Add match_on option scheme in configuration.rst
...
Minor documentation corrections: The list of ``match_on`` options was missing ``scheme``. Also, an unneeded period appeared after URI.
2022-08-04 08:42:36 -03:00
Tim Gates
35378d046f
docs: Fix a few typos
...
There are small typos in:
- tests/integration/test_record_mode.py
- tests/integration/test_stubs.py
- vcr/stubs/__init__.py
Fixes:
- Should read `repercussions` rather than `repurcussions`.
- Should read `superclass` rather than `superclas`.
- Should read `cassette` rather than `casssette`.
Signed-off-by: Tim Gates <tim.gates@iress.com >
2022-08-04 08:42:13 -03:00
Kevin McCarthy
9c46831a8e
release 4.2.0
v4.2.0
2022-06-29 16:53:45 -05:00
dependabot[bot]
fe596447ec
build(deps): bump actions/setup-python from 3 to 4
...
Bumps [actions/setup-python](https://github.com/actions/setup-python ) from 3 to 4.
- [Release notes](https://github.com/actions/setup-python/releases )
- [Commits](https://github.com/actions/setup-python/compare/v3...v4 )
---
updated-dependencies:
- dependency-name: actions/setup-python
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com >
2022-06-23 08:29:52 -03:00
Andre Ambrosio Boechat
be1035fd5d
Check if query params in the string URL are also included in the final params
2022-06-13 09:54:20 -03:00
Andre Ambrosio Boechat
eb96c590ff
Copy the way aiohttp builds the request url with query parameters
2022-06-13 09:54:20 -03:00
Andre Ambrosio Boechat
7add8c0bab
Don't assume params to be a dictionary
...
aiohttp also fails with pass parameter values with types other than
string, integer or float.
2022-06-13 09:54:20 -03:00
Justintime50
b1bc5c3a02
fix: docs wording from request to response
2022-05-22 11:26:06 -03:00
dependabot[bot]
86806aa9bc
Bump actions/checkout from 3.0.1 to 3.0.2
...
Bumps [actions/checkout](https://github.com/actions/checkout ) from 3.0.1 to 3.0.2.
- [Release notes](https://github.com/actions/checkout/releases )
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md )
- [Commits](https://github.com/actions/checkout/compare/v3.0.1...v3.0.2 )
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com >
2022-04-26 12:52:37 -03:00
Paulo Romeira
7e73085331
aiohttp: Add tests to aiohttp allow_redirects option
2022-04-19 11:10:41 -03:00
Paulo Romeira
3da66c8dee
aiohttp: Add support to allow_redirects option
2022-04-19 11:10:41 -03:00
immerrr
f5ea0304da
Use pytest-httpbin version with fix for HTTPS redirects
2022-04-19 09:32:25 -03:00
immerrr
25f715bc42
Fix httpx support (select between allow_redirects/follow_redirects)
2022-04-19 09:32:25 -03:00
dependabot[bot]
7d7164d7c7
Bump actions/setup-python from 2 to 3.1.0
...
Bumps [actions/setup-python](https://github.com/actions/setup-python ) from 2 to 3.1.0.
- [Release notes](https://github.com/actions/setup-python/releases )
- [Commits](https://github.com/actions/setup-python/compare/v2...v3.1.0 )
---
updated-dependencies:
- dependency-name: actions/setup-python
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com >
2022-04-19 09:11:17 -03:00
dependabot[bot]
fb065751dc
Bump actions/checkout from 3.0.0 to 3.0.1
...
Bumps [actions/checkout](https://github.com/actions/checkout ) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/actions/checkout/releases )
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md )
- [Commits](https://github.com/actions/checkout/compare/v3.0.0...v3.0.1 )
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com >
2022-04-19 09:06:03 -03:00
Jair Henrique
874cf06407
Drop support to python 3.6
2022-04-18 17:54:46 -03:00
dependabot[bot]
b0e83986f0
Bump actions/checkout from 2.4.0 to 3.0.0
...
Bumps [actions/checkout](https://github.com/actions/checkout ) from 2.4.0 to 3.0.0.
- [Release notes](https://github.com/actions/checkout/releases )
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md )
- [Commits](https://github.com/actions/checkout/compare/v2.4.0...v3.0.0 )
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com >
2022-04-16 17:12:21 -03:00
Ivan Malison
8c0bb73658
Merge pull request #615 from cclauss/patch-1
...
pip install -upgrade pip
2021-11-03 08:27:17 -06:00
Christian Clauss
43182d97de
pip install --upgrade pip
2021-11-03 14:32:39 +01:00
Christian Clauss
193210de49
pip install -upgrade pip
2021-11-03 14:30:37 +01:00
Christian Clauss
e05ebca5e5
Fix typos discovered by codespell
2021-11-03 08:10:17 -03:00
Jair Henrique
cd72278062
Fix urllib redirect tests
2021-11-03 08:09:51 -03:00
Jair Henrique
3c7b791783
Fix httplib2 tests
2021-11-03 08:09:36 -03:00
dependabot[bot]
7592efb8d9
Bump actions/checkout from 1 to 2.4.0
...
Bumps [actions/checkout](https://github.com/actions/checkout ) from 1 to 2.4.0.
- [Release notes](https://github.com/actions/checkout/releases )
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md )
- [Commits](https://github.com/actions/checkout/compare/v1...v2.4.0 )
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com >
2021-11-03 08:09:20 -03:00
Jair Henrique
5b2fc2712e
Change ci badge to github actions
2021-11-02 14:57:19 -10:00
Jair Henrique
c596a160b3
Move from travis to github actions
2021-11-02 10:31:00 -10:00
Ivan Malison
e68aa84649
Merge pull request #602 from scop/spelling
...
Spelling fixes
2021-08-16 04:04:29 +00:00
Ville Skyttä
678d56f608
Spelling fixes
2021-08-16 06:56:36 +03:00