csernazs / pytest-httpserver

Http server for pytest to test http clients
MIT License
219 stars 29 forks source link

Support Werkzeug 3.0 #264

Closed Stranger6667 closed 1 year ago

Stranger6667 commented 1 year ago

Currently, it gives the following error:

  File ".../python3.11/site-packages/pytest_httpserver/httpserver.py", line 26, in <module>
    from werkzeug.http import parse_authorization_header
ImportError: cannot import name 'parse_authorization_header' from 'werkzeug.http' (/.../python3.11/site-packages/werkzeug/http.py)
csernazs commented 1 year ago

Hi there,

Could you try it with the latest version of pytest-httpserver? I think I made a change in version 1.0.7 (1.0.8 is the latest) which fixed this.

With this commit: https://github.com/csernazs/pytest-httpserver/commit/089511d90dcb1044ae5b0b7a0a8b116f8b1b683b

I have updated poetry.lock and the tests run fine except the mypy what I will fix soon: https://github.com/csernazs/pytest-httpserver/actions/runs/6398183004

But the other tests which are testing the authentication as well were able to pass with werkzeug 3.0.0, eg: https://github.com/csernazs/pytest-httpserver/actions/runs/6398183004/job/17367739560#step:4:35

If you still see the error with 1.0.8 please let me know.

Stranger6667 commented 1 year ago

Oh, you are right! Thank you for pointing this out, the issue is on my side