2 ms·
Flask’s sample code is doing a bunch of things like spinning up db and stuff and setting up a pytest fixture, so it’s not a fair comparison. You can replace
by oefrha 7y ago
Flask’s sample code is doing a bunch of things like spinning up db and stuff and setting up a pytest fixture, so it’s not a fair comparison. You can replace
with httpx.Client(app=app) as client:
...
in the httpx sample code with
with app.test_client() as client:
...
for flask’s builtin test client and the rest is basically the same. Now that’s a fair comparison and neither is simpler than the other.
I guess one advantage of httpx is that developers might generally be more familiar with the requests response object API than the werkzeug response object API.