AndreyErmilov / pytest-mock-server

Mock server plugin for pytest
MIT License
27 stars 5 forks source link

return 403 when Flask==2.2.2 and Werkzeug==2.2.2 #9

Open eastonsuo opened 1 year ago

eastonsuo commented 1 year ago

run this code under Flask==2.2.2 and Werkzeug==2.2.2 will return 403

import pytest
import requests

@pytest.mark.server(url='/v1/books/', response=[{'id': 1}], method='GET')
def test_handler_responses():
    response = requests.get('http://localhost:5000/v1/books/')
    assert response.status_code == 200
    assert response.json() == [{'id': 1}]
mkdir700 commented 1 year ago

I got other error:

KeyError: WERKZEUG_SERVER_FD

the error details: https://github.com/cs01/gdbgui/issues/425

solution: https://github.com/cs01/gdbgui/issues/425#issuecomment-1083617101