Skip to content

test_request_with_content test fails with httpcore 0.15.0, Flask 2.2.2, and Werkzeug 2.2.2 #622

@mcepl

Description

@mcepl

When packaging this package for openSUSE/Factory (from the tarball here on GitHub) test_request_with_content test fails:

[   17s] =================================== FAILURES ===================================
[   17s] __________________________ test_request_with_content ___________________________
[   17s] 
[   17s] httpbin = <pytest_httpbin.serve.Server object at 0x7f5c9d61c5b0>
[   17s] 
[   17s]     def test_request_with_content(httpbin):
[   17s]         url = f"{httpbin.url}/post"
[   17s]         response = httpcore.request("POST", url, content=b'{"hello":"world"}')
[   17s] >       assert response.status == 200
[   17s] E       assert 500 == 200
[   17s] E        +  where 500 = <Response [500]>.status
[   17s] 
[   17s] tests/test_api.py:19: AssertionError
[   17s] ----------------------------- Captured stderr call -----------------------------
[   17s] 127.0.0.1 - - [23/Nov/2022 13:44:11] "POST /post HTTP/1.1" 500 265
[   17s] ------------------------------ Captured log call -------------------------------
[   17s] ERROR    httpbin.core:app.py:1741 Exception on /post [POST]
[   17s] Traceback (most recent call last):
[   17s]   File "/usr/lib/python3.8/site-packages/flask/app.py", line 2525, in wsgi_app
[   17s]     response = self.full_dispatch_request()
[   17s]   File "/usr/lib/python3.8/site-packages/flask/app.py", line 1822, in full_dispatch_request
[   17s]     rv = self.handle_user_exception(e)
[   17s]   File "/usr/lib/python3.8/site-packages/flask/app.py", line 1820, in full_dispatch_request
[   17s]     rv = self.dispatch_request()
[   17s]   File "/usr/lib/python3.8/site-packages/flask/app.py", line 1796, in dispatch_request
[   17s]     return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
[   17s]   File "/usr/lib/python3.8/site-packages/httpbin/core.py", line 427, in view_post
[   17s]     return jsonify(
[   17s]   File "/usr/lib/python3.8/site-packages/httpbin/core.py", line 73, in jsonify
[   17s]     response = flask_jsonify(*args, **kwargs)
[   17s]   File "/usr/lib/python3.8/site-packages/flask/json/__init__.py", line 342, in jsonify
[   17s]     return current_app.json.response(*args, **kwargs)
[   17s]   File "/usr/lib/python3.8/site-packages/flask/json/provider.py", line 281, in response
[   17s]     warnings.warn(
[   17s] DeprecationWarning: The 'JSONIFY_PRETTYPRINT_REGULAR' config key is deprecated and will be removed in Flask 2.3. Set 'app.json.compact' instead.
[   17s] ================= 1 failed, 141 passed, 15 deselected in 2.68s =================

Complete build log for details of all packages used and steps taken.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions