Jair Henrique
cdab3fcb30
Drop iscoroutinefunction fallback function for unsupported python
2023-07-23 12:30:58 -03:00
Sebastian Pipping
a045a46bb4
Merge pull request #740 from kevin1024/issue-512-fix-query-param-filter-for-aiohttp
...
Fix query param filter for aiohttp (fixes #517 )
2023-07-19 15:37:54 +02:00
Simon Charette
f7d76bd40a
Remove unnecessary dependency on six.
...
Remove the last remaining usag of it in VCR.testcase.
2023-07-16 22:22:34 -04:00
Sebastian Pipping
8336d66976
aiohttp_stubs.py: Stop leaking unfiltered URL into cassette responses
2023-07-10 16:11:26 +02:00
Sebastian Pipping
05f61ea56c
Make json.loads of Python >=3.6 decode bytes by itself
...
Quoting https://docs.python.org/3/library/json.html#json.loads :
> Changed in version 3.6: s can now be of type bytes or bytearray.
> The input encoding should be UTF-8, UTF-16 or UTF-32.
2023-07-07 20:00:57 +02:00
Jair Henrique
4f70152e7c
Enable rule B (flake8-bugbear) on ruff
2023-06-27 17:36:26 -03:00
Jair Henrique
016a394f2c
Enable E, W and F linters for ruff
2023-06-26 20:46:09 -03:00
Jair Henrique
6b2fc182c3
Improve string format
2023-06-26 20:46:09 -03:00
Jair Henrique
a77173c002
Use ruff as linter
2023-06-26 20:46:09 -03:00
Kevin McCarthy
34d5384318
bump version to v5.0.0
2023-06-26 12:54:39 -05:00
Sebastian Pipping
ad1010d0f8
Merge pull request #695 from kevin1024/drop37
...
Drop support for Python 3.7 (after 2023-06-27)
2023-06-26 18:32:42 +02:00
Amos Ng
d99593bcd3
Split persister errors into CassetteNotFoundError and CassetteDecodeError ( #681 )
2023-06-26 18:27:35 +02:00
Jair Henrique
b827cbe2da
Drop support to python 3.7
2023-06-26 11:46:20 -03:00
Kevin McCarthy
d2281ab646
version bump to v4.4.0
2023-06-26 09:17:41 -05:00
Sebastian Pipping
8b97fd6551
Merge pull request #644 from neliseiska/replace_assert_with_raise
...
Replace `assert` with `raise AssertionError`
2023-06-22 22:29:13 +02:00
Sebastian Pipping
6e511b67fd
Merge pull request #723 from kevin1024/issue-719-compression-urllib3-v2
...
Make decompression robust towards already decompressed input (arguably fixes #719 )
2023-06-22 15:45:10 +02:00
Sebastian Pipping
3411bedc06
Make response.raw.stream() work for urllib3 v2
2023-06-21 14:52:13 +02:00
Sebastian Pipping
438a65426b
filters.py: Make decompression robust towards decompressed input
2023-06-21 02:28:36 +02:00
Sebastian Pipping
b2a895cb89
Replace command "python" by "python3"
2023-06-18 23:07:04 +02:00
Sebastian Pipping
e3aae34ef7
Merge pull request #713 from mghantous/mg/read1
...
VCRHTTPResponse Not Working with Biopython 1.81
2023-06-12 13:08:00 +02:00
Sebastian Pipping
d613a814d3
vcr/unittest: Simplify file layout
...
.. and make "from vcr.unittest import VCRTestCase" work again.
2023-06-08 16:28:34 +02:00
Sebastian Pipping
3527d25ce8
vcr/unittest: Simplify super(C, self) in class C to super()
...
.. for Python 3
2023-06-08 16:28:34 +02:00
Sebastian Pipping
59263d6025
vcr/unittest: Resolve needless inheritence from object
2023-06-08 16:28:34 +02:00
Sebastian Pipping
2842cabec6
vcr/unittest: Remove unused logger
2023-06-08 16:28:34 +02:00
Sebastian Pipping
ad650a7ee1
vcr/unittest: Apply black formatting
2023-06-08 16:28:34 +02:00
Sebastian Pipping
bf30d9a5e5
vcr/unittest: Fix test test_get_vcr_with_matcher
...
Matcher needs attribute __name__ for function vcr.matchers.get_matchers_results .
2023-06-08 16:28:34 +02:00
Sebastian Pipping
f06f71ece4
vcr/unittest: Stop disguising MagicMock as Mock
2023-06-08 16:28:34 +02:00
Sebastian Pipping
1070d417b3
vcr/unittest: Apply 2to3
2023-06-08 16:28:34 +02:00
Sebastian Pipping
46726a9a61
vcr/unittest: Fix import of VCRTestCase in tests
2023-06-08 16:28:34 +02:00
Sebastian Pipping
87db8e69ff
vcr/unittest: Use unitest.mock rather than mock of PyPI
2023-06-08 16:28:34 +02:00
Sebastian Pipping
52701ebca4
vcr/unittest: Make import to vcrpy relative
2023-06-08 16:28:34 +02:00
Sebastian Pipping
69679dc3fc
vcr/unittest: Drop forward imports
...
.. to resolve import ambiguity.
2023-06-08 16:28:34 +02:00
Sebastian Pipping
c13f33b1e0
Add unmodified vcrpy-unittest code
...
Source commit is a2fd7625fde1ea15c8982759b07007aef40424b3.
License is MIT just like vcrpy.
2023-06-08 16:28:34 +02:00
Matt Ghantous
0add77d5ae
Add read1 method to VCRHTTPResponse
2023-06-05 23:20:52 -04:00
Abram Clark
3b41f0ede3
Fix for #174 to prevent filters from corrupting request
2023-05-27 09:40:53 -03:00
Kevin McCarthy
0e06836908
bump version to v4.3.1
2023-05-26 11:02:14 -05:00
Sebastian Pipping
89f2005250
Fix VCRHTTPResponse for requests.cookies.extract_cookies_to_jar
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
ac20cd1dd3
Tolerate urllib3.response.HTTPResponse.msg being None
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
Kevin McCarthy
62cb151918
Release v4.3.0
2023-05-24 13:48:31 -05: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
Sebastian Pipping
4994c53590
Fix formatting with regard to black 23.3.0
2023-05-05 10:14:46 -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
995020bf06
Add record_on_exception flag.
...
Defaults to True, which maintains historical behavior.
Fixes #205 .
2022-10-31 22:43:03 -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
Jair Henrique
0eece7f96e
Add isort to code lint
2022-10-09 11:35:37 -03:00