* Fix how redirects are handled so we can have requests with the same URL be used distinctly
* Add support for request_info. Remove `past` kwarg.
* Remove as e to make linter happy
* Add unreleased 3.0.0 to changelog.
- Cleaned up fix to prevent additional nesting
- Added unit test
Fixes error:
```
> splits = [p.partition(b"=") for p in request.body.split(b"&")]
E AttributeError: 'NoneType' object has no attribute 'split'
```
Format with line length 110 to match flake8
make black part of linting check
Update travis spec for updated black requirements
Add diff output for black on failure
update changelog
* Increment version and add Python2.x deprecation warning
Change test to actually test no warnings when on python3
flake8 compliant
* fix development status classifier
* 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
* 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.
* 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.
In order to use the new assert mechanism that returns explicit assertion failure message, all the default matchers does not return a boolean, but only do an assert statement with a basic assertion message (value_1 != value_2).
The requests_match function has been refactored to use the 'get_matchers_results' function in order to have explicit failures that are logged if any.
Many unit tests have been changed as the matchers does not return a boolean value anymore.
Note: Only the matchers "body" and "raw_body" does not have an assertion message, the body values might be big and not useful to be display to spot the differences.
The function returns two list:
- the first one is the list of matchers names that have succeeded.
- the second is a list of tuples with the failed matchers names and the related assertion message like this ("matcher_name", "assertion_message").
If the second list is empty, it means that all the matchers have passed.
A matcher can now return other results than a boolean :
- An AssertionError exception meaning that the matcher failed, with the exception we get the assertion failure message.
- None, in case we do an assert in the matcher, meaning that the assertion has passed, the matcher is considered as a success then.
- Boolean that indicates if a matcher failed or not. If there is no match, a boolean does not give any clue what it is the differences compared to the assertion.
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.
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.