1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-08 16:53:23 +00:00
Commit Graph

217 Commits

Author SHA1 Message Date
Josh Peak
cc752cf790 Collect and aggregate code coverage across all test environments (#460)
* Collect and aggregate code coverage across all test environments

Add Coveralls badge to readme

Try CodeCov integration

Setup coverage badge for CodeCov

Fix CodeCov Badge

* Set code coverage regression threshold

Attempt to cache bust some boto3 issues on TravisCI

* Disable legacy secure strings

* Skip boto3 tests on TRAVIS_PULL_REQUEST due to credentials being unavailable

Address flake8 issues

Debug TRAVIS_PULL_REQUEST ENV Var

Trying to get boto3 tests to skip on forked PRs

boto3 is not an allowed failure

remove TRAVIS ENV debugging

* remove pytest skipif that wasn't working

* Ignore coverage files
2019-08-06 16:41:42 +10:00
Laurent Mazuel
e3b7116564 aiohttp headers are case insensitive (#461)
* aiohttp headers are case insensitive

* flakes
2019-07-31 09:17:54 +10:00
Stefan Tjarks
988ac335d4 Fix log format bug
`{}` is not a valid placeholder in log formatting.
2019-07-17 07:46:40 -07:00
Arthur Hamon
200262fb5c Merge pull request #411 from jans-forks/fix/382-boto3
Fixes #382 boto3 compatibility.
2019-07-15 19:38:56 +02:00
Arthur Hamon
2d96d35621 delete test_boto3_without_vcr test as it does not test vcr module 2019-07-13 14:13:43 +02:00
Arthur Hamon
6ca7cf3cc6 refactor boto3 integration test using fixtures instead of global variables 2019-07-13 14:13:43 +02:00
Arthur Hamon
5e76e4733d fix real connection on boto3 stub, adding not set parameters manually
Set `assert_hostname` and `cert_reqs` real connection attributes with default values.
2019-07-13 14:13:35 +02:00
Jan Gazda
4daafcc687 Rename testing user 2019-07-13 12:51:50 +02:00
Jan Gazda
347026f42c Fix #382 - boto3 compatibility
* Add support for PyYaml5.1
* Unpin requests in Tox
* Unpin urllib3 in Tox
* Unpin Flask in Tox
* Add env vars to Tox for boto3 tests
2019-07-13 12:51:50 +02:00
Luiz Menezes
792c5c4558 Record intermediary redirect responses on aiohttp stub 2019-07-09 18:39:36 -03:00
Stefan T
a17624a464 Record json kwarg in aiohttp request (#412)
* Record `json` kwarg in aiohttp request

Aiohttp supports `data` and `json` parameters to make a request.
Aiohttp enforces that only one is used make a request.

* Log when aiohttp stub makes request to live server

resolves: #406

* Record aiohttp `auth` request kwarg

Aiohttp request supports basic auth via the `auth` method parameter.
It is set as a request header by aiohttp ClientRequest.
2019-07-05 10:57:39 +10:00
Luiz Menezes
bbab27ed1b Use primitive types when recording cassettes using aiohttp stub (#454) 2019-07-05 10:52:08 +10:00
Martin Valgur
c6e7cb12c6 Merge branch 'master' into unicode-match-on-body 2019-07-01 22:09:57 +03:00
Stanislav Evseev
7c14d81ab1 CHANGE: return None from json if body is empty 2019-07-01 14:25:38 +02:00
Arthur Hamon
d682e7b19a Fix all warnings (#449)
* fix typo in pytest.mark.xskip

Change xskip by skipif marker as xskip is an unknown pytest marker.

* fix FileModeWarning

This fix the following warning:
FileModeWarning: Requests has determined the content-length for this request using the binary size of the file: however, the file has been opened in text mode (i.e. without the 'b' flag in the mode). This may lead to an incorrect content-length. In Requests 3.0, support will be removed for files in text mode.

* fix waring "calling yaml.load() without Loader=... is deprecated"
This fix the following warning:
YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.

* fix collections.abc deprecation warning in python 3.7.

* update Flask dependency in order to get rid of the Request.is_xhr warning

This fix the following warning:
DeprecationWarning: 'Request.is_xhr' is deprecated as of version 0.13 and will be removed in version 1.0. The 'X-Requested-With' header is not standard and is unreliable. You may be able to use 'accept_mimetypes' instead.
2019-07-01 17:45:01 +10:00
Steinn Eldjárn Sigurðarson
e8a9a65bef Make test use stream output to test MockStream interface 2019-06-28 13:35:05 +00:00
Steinn Eldjárn Sigurðarson
67b03b45c3 Add output option to use response.content stream 2019-06-28 13:34:48 +00:00
Steinn Eldjárn Sigurðarson
6c41b8b723 Use built-in helpers to avoid use of async keywords which cause syntax errors on 2.x 2019-06-28 13:30:14 +00:00
Steinn Eldjárn Sigurðarson
cc55ef5b35 Add test for MockStream on aiohttp 2019-06-28 12:55:54 +00:00
Arthur Hamon
7724b364aa urllib3 has a new default behavior with PoolManager object creation
By default, from version urllib3=>1.25, urllib3 requires and validates certificates by default when using HTTPS (https://github.com/urllib3/urllib3/blob/master/CHANGES.rst#125-2019-04-22).
Set explicitly that we deactivate certificates validation with cert_reqs=`CERT_NONE`.
2019-06-13 16:04:26 +02:00
Arthur Hamon
c4803dbc4d httplib2 has issues validating certificate with python 2.7, disabling it 2019-06-13 16:04:26 +02:00
Luiz Menezes
fb84928ef6 Fix build problems on requests tests due to SSL certificate problems 2019-06-10 16:57:24 -03:00
Hugo
8f4e089200 Upgrade Python syntax with pyupgrade 2019-05-22 17:44:36 +03:00
Thomas Grainger
4ef5205094 support ClientResponse.text(errors=) kwarg 2018-10-15 03:00:19 +01:00
Luiz Menezes
b38915a89a Fix httplib2 compatibility with py37 2018-09-18 18:42:22 -03:00
Felix Yan
e93060c81b Fix compatibility with Python 3.7 2018-09-18 16:41:42 -03:00
Luiz Menezes
cb4228cf90 Merge pull request #390 from kevin1024/fix-aiohttp-client
Fix vcr to support aiohttp client requests
2018-09-18 14:42:59 -03:00
Luiz Menezes
f7c051cde6 Drop support to asyncio.coroutine (py34 async/await syntax) 2018-09-18 14:14:25 -03:00
Luiz Menezes
e9d00a5e2a Fix test_use_proxy cassette response type 2018-09-18 11:13:39 -03:00
Danilo Shiga
957db22d5c Improve test_use_proxy with cassette headers and play_count assertion 2018-09-18 11:06:15 -03:00
Martin Valgur
302ea35d9a Fix matching on 'body' failing when Unicode symbols are present in them
Matching on bodies uses urllib.parse.parse_qs(), which fails to handle
UTF-8+URLEncoded POST bodies when the input is `bytes` rather than `str`,
causing matching to fail..
Fixed this by always doing decode('ascii') on URLEncoded POST bodies first.
2018-09-06 19:41:37 +03:00
Martin Valgur
895850b197 Fix failing unit test on Windows
test_xmlrpclib was failing with "can't pickle thread.lock objects" on Windows.
Other small issues were related to backslashes in paths and different line endings.
2018-09-06 19:41:37 +03:00
Stefan Tjarks
e559be758a Fix aiohttp patch to work with aiohttp >= 3.3
Aiohttp expects an awaitable instance to be returned from
`ClientSession._request` though `asyncio.coroutine` decorated function
do not implement `__await__`. By changing the syntax and dropping Python
3.4 support we fix this issue.
2018-07-25 13:24:29 -03:00
Samuel Fekete
ff7dd06f47 fix proxy for Python 2 2018-07-13 16:44:19 +01:00
Samuel Fekete
4b6b5effc7 Add headers in proxy server response 2018-07-13 16:44:19 +01:00
Samuel Fekete
06dc2190d6 Fix format string for Python 2.6 2018-07-13 16:40:35 +01:00
Samuel Fekete
bed9e520a3 Fix socketserver for Python 3 2018-07-13 16:40:35 +01:00
Samuel Fekete
365a98bf66 Fix failing tests 2018-07-13 16:40:35 +01:00
Samuel Fekete
236dc1f4f2 Add test for proxies 2018-07-13 16:34:21 +01:00
Luiz Menezes
aff71c5107 Merge pull request #356 from kgraves/fix_before_record_response_mutates_actual_response
fixes before_record_response mutates response
2018-07-12 23:19:57 -03:00
Luiz Menezes
306238d561 Test aiohttp usage with query strings on the URL 2018-07-08 23:06:22 -03:00
Luiz Menezes
75cb067e29 Fix content type being passed to aiohttp response stub 2018-07-07 23:56:39 -03:00
kg
ba79174a1f fixes before_record_response mutates response
When no cassette exists, it's expected that the response returned, should be
the original, unchanged response. The response recorded in the cassette should be
that which is returned by the before_record_response callback.

But on subsequent requests/responses (when a cassette exists), the responses
returned should be exactly what is in the cassette.

resolves #355
2018-05-24 01:12:13 +00:00
Luiz Menezes
3009cbbbe9 Skip requests test instead of failing for python >= 3.6 2018-05-16 12:39:44 -03:00
Luiz Menezes
f811b41ad9 Fix tests aiohttp_utils.aiohttp_request return values 2018-05-16 11:12:51 -03:00
Luiz Menezes
140bc2ee74 Allow test failure on pypy3+aiohttp 2018-05-08 09:45:17 -03:00
Luiz Menezes
867fd9ab4b Ignore flake8 for entire file on aiohttp_utils 2018-05-07 10:58:09 -03:00
Luiz Menezes
545c903ee2 pep8 fix on aiohttp_utils 2018-05-07 10:00:27 -03:00
Luiz Menezes
cd864b5eca Fix aiohttp tests to include content type when parsing response to json 2018-05-07 09:55:12 -03:00
Luiz Menezes
689d68a0a2 Use async syntax on aiohttp_utils 2018-05-07 09:25:21 -03:00