Commit Graph

222 Commits

Author SHA1 Message Date
Shipeng Feng cc536c8a7b Fixed stream_with_context if decorated function has parameters 2016-04-01 16:17:45 -07:00
Reuven 4dc2ef19ea Use pytest.raises() instead of try/catch with asser 0
This is somehow more readable, and enable using the features of pytest's ExeptionInfo (such as errisinstance).
2016-03-04 13:30:40 +02:00
David Lord 7b1ebfbc4d Merge pull request #1679 from miguelgrinberg/passthrough-errors
Werkzeug should not block propagated exceptions from Flask
2016-01-25 22:17:04 -08:00
Jeff Widman daceb3e3a0 Add support for serializing top-level arrays to JSON
Fix #170, #248, #510, #673, #1177
2016-01-13 13:20:11 -08:00
Miguel Grinberg 952a6c8989 Werkzeug should not block propagated exceptions from Flask 2016-01-02 14:18:36 -08:00
Timo Furrer d526932a09 support timedelta for SEND_FILE_MAX_AGE_DEFAULT config variable 2015-10-24 07:04:23 +02:00
Markus Unterwaditzer 81ae94a5fd Merge branch '0.10-maintenance' 2015-07-16 12:05:07 +02:00
Alan Hamlett 99c99c4c16 Enable autoescape for `render_template_string` 2015-07-04 23:41:43 +02:00
ThiefMaster bbaf20de7c Add pop and setdefault to AppCtxGlobals 2015-06-20 18:04:58 +02:00
Alexander Pantyukhin 5e12748d0e Ignore before_render_template return values 2015-06-17 15:42:39 +02:00
Alexander Pantyukhin eae37b575d fix test_signals 2015-06-17 15:42:39 +02:00
Alexander Pantyukhin e57199e0c4 fix test_signals 2015-06-17 15:42:39 +02:00
Alexander Pantyukhin 967907ee81 before_render_template signal can override render template. 2015-06-17 15:42:39 +02:00
Alexander Pantyukhin 1fbeb337c4 fix endline in the signal.py 2015-06-17 15:42:39 +02:00
Alexander Pantyukhin d53d5c732b before_render_template signal 2015-06-17 15:42:39 +02:00
Markus Unterwaditzer d13a1b363e Rename jinja_env_class
Inspired by #1056
2015-06-06 06:29:26 +02:00
Markus Unterwaditzer d00f5cc9fe Merge branch 'ThiefMaster-override-jinja-env' 2015-06-06 03:30:49 +02:00
Joshua Carp 348bf52188 Handle empty deque on errorhandler lookup.
After registering a custom errorhandler by exception class, raising any
unhandled exception in a view function swallows the error and instead
throws an `IndexError` on trying to look up the appropriate handler.
This patch avoids the uninformative `IndexError` and preserves the
original exception by looping until the deque of classes is empty, not
forever.
2015-06-02 16:13:30 -04:00
Markus Unterwaditzer 0bac2ade91 Fix formatting errors 2015-04-11 20:52:47 +02:00
Phil Schaf fd8e6b26f9 removed ExceptionHandlerDict 2015-04-11 14:05:22 +02:00
ThiefMaster 08ac3aa4e3 Allow custom jinja environments
This is useful e.g. when using the new Jinja Environment
attributes added in mitsuhiko/jinja2#404
2015-04-06 15:03:00 +02:00
Brandon Sandrowicz 20f62e828b Fix Possible Typo
Looks like that was meant to be `config_key`. It works by accident because the function is defined in the same scope as the look that passes `config_key` to `apprunner`.
2015-04-02 01:48:48 +02:00
Markus Unterwaditzer 1577e1386e Revert "Don't use threads in this test"
This reverts commit 78cd4161f0.
2015-03-29 23:03:38 +02:00
Markus Unterwaditzer 78cd4161f0 Don't use threads in this test
I think test failures would've been ignored if there were some.

Fixes #1401
2015-03-29 13:40:35 +02:00
Markus Unterwaditzer 33bad011c3 Merge branch 'mjpieters-appcontext_ignore_handled_exception' 2015-03-23 16:44:32 +01:00
Martijn Pieters ec0d208bc1 Switch away from using None as default value for the exception when tearing down a context.
When an exception has been handled when using the request / app context in a with statement, `sys.exc_info()` will still contain the exception information even though it has been handled already. The `__exit__` methods pass in `None` for the exception value in that case, which needs to be distinguisable from the default value for the `exc` parameter. Use a dedicated singleton sentinel value instead.
2015-03-23 15:17:19 +00:00
Markus Unterwaditzer 1aa8a54b17 Always run memory tests 2015-03-22 12:49:47 +01:00
Keyan Pishdadian 1cd9e91810 Changed error message to include actual exception contents 2015-03-05 13:04:38 -05:00
Keyan Pishdadian d6a1307f9d Change strings to bytes to support Python3, typo in function name 2015-03-04 15:14:43 -05:00
Keyan Pishdadian 294961e6fc Change tests to support older response format 2015-03-04 14:48:08 -05:00
Keyan Pishdadian 39e66ca6d7 Add tests for adding exception to response contents only when DEBUG is True 2015-03-04 14:40:16 -05:00
Chris Rebert 6d2c076a3b make test_request_preprocessing_early_return more thorough 2015-02-06 13:11:23 -08:00
Markus Unterwaditzer 1158e22958 Fix test under Python 3 2015-02-06 18:20:17 +01:00
Markus Unterwaditzer 5fa76f6800 Add testcase for behavior described in #1338 2015-02-05 22:13:19 +01:00
Ben Jones 61263e08f9 Add datetime.date support to JSONEncoder 2015-01-23 07:44:17 -06:00
Parkayun 33534bb4a9 Happy New Year 2015 2015-01-02 11:35:00 +09:00
Michael Hall 98b155c65d Fixed #1288: app.add_url_rule() should look for OPTIONS methods in a case-insensitive manner 2014-12-26 08:58:35 -05:00
Marc Abramowitz d9402fc0c0 Make `jsonify` terminate responses with a newline
This came up in the context of
https://github.com/kennethreitz/httpbin/issues/168
2014-12-07 14:37:26 -08:00
Markus Unterwaditzer a1b273658d Merge pull request #1222 from defuz/templates_auto_reload-eq-none
Set TEMPLATE_AUTO_RELOAD default value to None
2014-11-02 20:46:48 +01:00
Petr Zemek ec3d5800f2 Put two spaces before inline comments when there is only one space.
PEP8 (E261) suggests to use at least two spaces before inline comments.
2014-10-27 11:24:15 +01:00
Petr Zemek 4840fc0edc Change `== None` to `is None`.
PEP8 (E711) suggests that comparison to None should be `cond is None`.
2014-10-27 11:17:49 +01:00
Petr Zemek e41bf1e181 Remove two redundant empty lines.
PEP8 suggests to use two empty lines to separate functions, not three.
2014-10-27 11:13:03 +01:00
defuz f88765d504 set TEMPLATE_AUTO_RELOAD default value to None 2014-10-26 18:28:12 +03:00
defuz 5e8d503098 add tests for trim_namespace argument of app.config.get_namespace 2014-10-24 13:11:10 +04:00
Markus Unterwaditzer bd232e5c82 PEP8 2014-10-21 19:11:54 +02:00
Gilman Callsen d425279650 Improve compression by removing whitespace from separators when using jsonify() and JSONIFY_PRETTYPRINT_REGULAR is False.
Commit includes Changelog entry and two new tests in test_basic.py.
2014-10-21 19:11:06 +02:00
INADA Naoki 4d4a639ba4 Add test for deprecated flask.Request properties. 2014-10-15 03:32:04 +09:00
Davide Ceretti 93c190a8fd Add unittest for appcontext_tearing_down signal 2014-10-07 07:34:19 +01:00
Markus Unterwaditzer c6795eb626 Remove useless unittest imports 2014-09-21 16:47:38 +02:00
Paulo Bu 3f67fe94f1 Adds 2 tests for Flask.run method 2014-09-14 17:27:19 +02:00