mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
Fix test_conflicting_post_params to work on pytest 5 (#5305)
The non-contextmanager form of pytest.raises was removed in pytest 5. http://doc.pytest.org/en/latest/deprecations.html#raises-warns-with-a-string-as-the-second-argument It was used here to support Python < 2.7, but that is no longer needed. https://github.com/psf/requests/pull/1503#issuecomment-22333666 Fixes https://github.com/psf/requests/issues/5304
This commit is contained in:
@@ -774,8 +774,10 @@ class TestRequests:
|
||||
def test_conflicting_post_params(self, httpbin):
|
||||
url = httpbin('post')
|
||||
with open('Pipfile') as f:
|
||||
pytest.raises(ValueError, "requests.post(url, data='[{\"some\": \"data\"}]', files={'some': f})")
|
||||
pytest.raises(ValueError, "requests.post(url, data=u('[{\"some\": \"data\"}]'), files={'some': f})")
|
||||
with pytest.raises(ValueError):
|
||||
requests.post(url, data='[{"some": "data"}]', files={'some': f})
|
||||
with pytest.raises(ValueError):
|
||||
requests.post(url, data=u('[{"some": "data"}]'), files={'some': f})
|
||||
|
||||
def test_request_ok_set(self, httpbin):
|
||||
r = requests.get(httpbin('status', '404'))
|
||||
|
||||
Reference in New Issue
Block a user