Sebastian Pipping
7c402ae4b0
test_vcr.py: Clarify that test_vcr_before_record_request_params is an offline test
2023-05-26 10:55:44 -05:00
Sebastian Pipping
b5c0938d2e
tox.ini: Cover both urllib3 v1 and v2
2023-05-26 10:55:44 -05:00
Sebastian Pipping
3ad93fff42
tox.ini: Drop needless "boto3: urllib3"
...
boto3 depends on botocore which in turn depends on urllib3.
2023-05-26 10:55:44 -05:00
Sebastian Pipping
89f2005250
Fix VCRHTTPResponse for requests.cookies.extract_cookies_to_jar
2023-05-26 10:55:44 -05:00
Sebastian Pipping
88c0039089
Make test "test_cookies" more mean and helpful
2023-05-26 10:55:44 -05:00
Sebastian Pipping
1b3a1235f2
Make VCRHTTPResponse interface satisfy urllib3.response.HTTPResponse
2023-05-26 10:55:44 -05:00
Sebastian Pipping
fd1aaab3bf
Respect urllib3.response.HTTPResponse.data
2023-05-26 10:55:44 -05:00
Sebastian Pipping
00da5ac5af
Make test_headers robust with regard to order of headers
2023-05-26 10:55:44 -05:00
Sebastian Pipping
ac20cd1dd3
Tolerate urllib3.response.HTTPResponse.msg being None
2023-05-26 10:55:44 -05:00
Sonny V
64d6811eda
build(tox.ini): revert pinning urllib to <2
...
In #690 a quick fix was introduced to get a green ci, this change should no longer be required.
2023-05-26 10:55:44 -05:00
Sonny V
51c99bb9df
fix: use urllib3.connection where needed.
...
Since urllib3 v2 the re-export of connection.HTTPConnection in
urllib3.connectionpool was removed.
In this commit we use urllib3.connection where needed. Some references
to connectionpool.HTTPConnection are still there for backward
compatibility.
Closes #688
2023-05-26 10:55:44 -05:00
Sebastian Pipping
43484e7cff
test_aiohttp.py: Make cookie tests use pytest-httpbin ( #706 )
...
.. to make them faster and more robust.
2023-05-26 01:16:20 +02:00
Sebastian Pipping
199f9f07f8
Merge pull request #705 from kevin1024/fix-test-dependencies
...
Fix test dependencies
2023-05-25 20:29:37 +02:00
Sebastian Pipping
13af8cae43
setup.py: Add missing test dependencies
2023-05-25 16:40:42 +02:00
Sebastian Pipping
436b62f587
setup.py: Drop unused test dependency "mock"
...
All imports use unittest.mock rather than mock of PyPI.
2023-05-25 16:33:14 +02:00
Sebastian Pipping
5b40a67b3b
setup.py: Extract variable tests_require
...
.. and apply sorting, but nothing more
2023-05-25 16:32:08 +02:00
Sebastian Pipping
c41bd2bb40
Stop installing libgnutls28-dev
2023-05-24 16:41:46 -03:00
Kevin McCarthy
62cb151918
Release v4.3.0
v4.3.0
2023-05-24 13:48:31 -05:00
Sebastian Pipping
1a3bc67c7c
Merge pull request #701 from kevin1024/run-actions-on-push-to-topic-branches
...
Allow triggering CI manually
2023-05-17 18:01:28 +02:00
Sebastian Pipping
aeff51bd79
main.yml: Allow triggering CI manually
2023-05-17 16:45:13 +02:00
Sebastian Pipping
e9f0ede9dd
main.yml: Drop superflous specification of branches
2023-05-17 16:44:54 +02:00
Sebastian Pipping
0235eab766
Merge pull request #698 from kevin1024/reduce-legacy
...
Drop support for botocore <1.11.0 and requests <2.16.2 (fixes #693 )
2023-05-15 15:55:15 +02:00
Sebastian Pipping
31c8dc0a1e
Drop support for requests <2.16.2
2023-05-15 14:06:26 +02:00
Sebastian Pipping
24af48d468
Drop support for botocore <1.11.0
2023-05-15 14:06:26 +02:00
Kian-Meng Ang
44359bfe43
Fix typo, succeedes -> succeeds ( #672 )
...
Found via `codespell`.
2023-05-13 17:03:27 +02:00
Jair Henrique
14cef83c15
Move some tests to use mockbin instead httpbin
2023-05-11 17:03:54 -03:00
Jair Henrique
77da67ef0a
Remove duplicated fixture
2023-05-11 10:05:50 -03:00
dependabot[bot]
58329f812b
build(deps): bump actions/checkout from 3.1.0 to 3.5.2
...
Bumps [actions/checkout](https://github.com/actions/checkout ) from 3.1.0 to 3.5.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.1.0...v3.5.2 )
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com >
2023-05-08 09:15:50 -03:00
Sebastian Pipping
06913ce21a
tox.ini: Exclude ./venv/ from flake8
2023-05-05 10:14:46 -03:00
Sebastian Pipping
4994c53590
Fix formatting with regard to black 23.3.0
2023-05-05 10:14:46 -03:00
Sebastian Pipping
1d90853f3b
tox.ini: Quick-fix the CI for recent tox and recent urllib3
2023-05-05 10:14:46 -03: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