pytest-mock-server icon indicating copy to clipboard operation
pytest-mock-server copied to clipboard

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

Open eastonsuo opened this issue 3 years ago • 1 comments

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}]

eastonsuo avatar Nov 21 '22 08:11 eastonsuo

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

mkdir700 avatar Jan 05 '23 04:01 mkdir700