def test_connection_pooling_200(app): responses.add(responses.GET, 'http://example.com', json={'status': 'OK'}, status=200) with app.test_request_context(): main.connection_pooling(flask.request)
def test_connection_pooling_404(app): responses.add(responses.GET, 'http://example.com', json={'error': 'not found'}, status=404) with app.test_request_context(): with pytest.raises(requests.exceptions.HTTPError): main.connection_pooling(flask.request)