We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0d95bca commit 93e4127Copy full SHA for 93e4127
tests/test_errors.py
@@ -291,12 +291,13 @@ def get(self):
291
292
app.config['PROPAGATE_EXCEPTIONS'] = True
293
294
- response = client.get('/api/test/')
295
- assert response.status_code == 500
296
- assert response.content_type == 'application/json'
+ # From the Flask docs:
+ # PROPAGATE_EXCEPTIONS
+ # Exceptions are re-raised rather than being handled by the app’s error handlers.
297
+ # If not set, this is implicitly true if TESTING or DEBUG is enabled.
298
+ with pytest.raises(Exception):
299
+ response = client.get('/api/test/')
300
- data = json.loads(response.data.decode('utf8'))
- assert 'message' in data
301
302
def test_custom_default_errorhandler(self, app, client):
303
api = restplus.Api(app)
0 commit comments