Thomas Grainger
b1c45cd249
return values from generator decorator
2024-01-23 15:07:23 +00:00
Thomas Grainger
6d7a842a33
fix test_tornado_exception_can_be_caught RuntimeError: generator raised StopIteration
2024-01-23 12:24:48 +00:00
Thomas Grainger
5104b1f462
Merge branch 'master' of github.com:kevin1024/vcrpy into fix-resource-warning-2
2024-01-23 11:03:49 +00:00
Allan Crooks
54bc6467eb
Run linters.
2024-01-22 23:13:10 -03:00
Allan Crooks
c5487384ee
Fix handling of encoded content in HTTPX stub.
...
Also copied over and adjusted some of the tests from
test_requests.py relating to gzipped handling to show
that the HTTPX stub is behaving in a consistent way to
how the requests stub is.
2024-01-22 23:13:10 -03:00
Allan Crooks
5cf23298ac
HTTPX stub now generates cassettes in the same format as other stubs.
...
As part of this, I've removed the tests which inspect the
data type of the response content in the cassette. That
behaviour should be controlled via the inbuilt serializers.
2024-01-22 23:13:10 -03:00
Allan Crooks
5fa7010712
Allow HTTPX stub to read cassettes generated by other stubs.
...
This was due to a custom format being defined in the HTTPX stub.
2024-01-22 23:13:10 -03:00
Thomas Grainger
cc4d03c62e
close unremoved connections (pool already removed the connection)
2023-12-15 19:11:25 +00:00
Thomas Grainger
d39c26b358
remember to close removed connections
2023-12-15 14:26:44 +00:00
Thomas Grainger
d76c243513
Revert "Fix ResourceWarning unclosed socket"
...
This reverts commit f4144359f6 .
2023-12-15 14:01:14 +00:00
Thomas Grainger
5cff354ec8
Revert "fix a KeyError"
...
This reverts commit fa789e975b .
2023-12-15 14:01:10 +00:00
Thomas Grainger
fa789e975b
fix a KeyError
2023-12-15 11:07:56 +00:00
Thomas Grainger
17c78bff9e
Merge branch 'master' of github.com:kevin1024/vcrpy into fix-resource-warning-2
2023-12-15 10:48:27 +00:00
Jair Henrique
88cf01aa14
Fix format code
2023-12-12 14:24:22 -03:00
Parker Hancock
85ae012d9c
fix linting
2023-12-12 14:24:22 -03:00
Parker Hancock
db1e9e7180
make cassettes human readable
2023-12-12 14:24:22 -03:00
Jair Henrique
cebdd45849
Use ruff to check code format intead of black
2023-12-10 20:12:09 -03:00
Parker Hancock
5532c0b4cf
more attempts to make the linters happy
2023-12-08 16:38:33 -03:00
Parker Hancock
f4467a8d6c
make linters happy
2023-12-08 16:38:33 -03:00
Parker Hancock
e8e9a4af9f
remove unnecssary comment
2023-12-08 16:38:33 -03:00
Parker Hancock
7bf8f65815
fixes for httpx
2023-12-08 16:38:33 -03:00
Michał Górny
69621c67fb
Copy debuglevel and _http_vsn attrs into response classes
...
Copy the `debuglevel` and `_http_vsn` attributes from base connection
class into response classes, in order to fix compatibility with
Python 3.12. For reasons I don't comprehend, these end up being called
on the class rather than instance, so regular proxying logic does not
work.
Fixes #707
2023-08-09 10:09:12 -03:00
Mohammad Razavi
f4144359f6
Fix ResourceWarning unclosed socket
...
This PR fixes issue #710 by properly closing the underlying socket. It
first uses `pool._put_conn` to keep the connection in the pool, and
later removes and closes it when the context manager exits.
I was unsure about the exact purpose of the `ConnectonRemove` class,
so I made minimal changes to minimize the risk of breaking the code
and there may be better solutions for fixing this issue.
For example, the `urllib3.connectionpool.HTTPConnectionPool` will
utilize a weakref to terminate pool connections. By appending our
connection to it, it will also take care of closing our connection. So
another solution could be to modify the `__exit__` in
`patch.ConnectionRemover` method and add our connection to the pool:
```py
class ConnectionRemover:
...
def __exit__(self, *args):
for pool, connections in self._connection_pool_to_connections.items():
for connection in connections:
if isinstance(connection, self._connection_class):
pool._put_conn(connection)
```
2023-08-07 08:42:58 +02:00
Jair Henrique
69de388649
Drop simplejson support
2023-08-01 08:53:31 -03:00
Jair Henrique
6446d00e27
Drop boto 2 support
2023-07-31 08:49:23 -03:00
Kevin McCarthy
d6bded1820
bump version to v5.1.0
2023-07-30 17:11:15 -10:00
Sebastian Pipping
e7c00a4bf9
Merge pull request #739 from kevin1024/issue-734-fix-body-matcher-for-chunked-requests
...
Fix body matcher for chunked requests (fixes #734 )
2023-07-23 23:22:34 +02:00
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
a6b9a070a5
matchers.py: Decode chunked request bodies
2023-07-08 02:25:51 +02:00
Sebastian Pipping
e35205c5c8
matchers.py: Support transforming the request body multiple times
2023-07-08 01:29:19 +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