mitsuhiko/flask — Issue #381: Consider debug=True in test client.
Author: rduplain
Created: 2012-01-17 04:25:58+00:00
State: open

If the test client could set debug=True, it would allow testing with assertions in view functions hit by the test client.

When updating tests for pull request 336, I noticed the testing pattern of making assertions inside an inner view function -- while clever -- must be done carefully. Because the test client does not set debug=True, the exceptions caused by the assertions were swallowed. With debug=False in the test client, you have to verify the status code in the test client to ensure all assertions pass, which the test case now does.
http://github.com/mitsuhiko/flask/blob/master/flask/testsuite/basic.py#L363

Here's the pull request for reference:
http://github.com/mitsuhiko/flask/pull/336