Commit graph

3662 commits

Author SHA1 Message Date
David Lord
54519ef028
document behavior of very generic error handlers 2019-06-21 08:22:35 -07:00
David Lord
9054f6d639
always pass InternalServerError instance to 500 handler 2019-06-19 14:52:25 -07:00
David Lord
2fa30f6a9e
Merge pull request #3104 from eladm26/adding_models_converter
moving match_request to RequestContext.push to enable ModelConverter
2019-06-13 12:46:53 -07:00
David Lord
c65863912b
move url matching after opening session 2019-06-13 12:40:01 -07:00
Elad Moshe
1ff98a2d21
wait until app ctx is ready before matching url
`RequestContext.match_request` is moved from `__init__` to `push`. This
causes matching to happen later, when the app context is available.
This enables URL converters that use things such as the database.
2019-06-13 08:32:23 -07:00
David Lord
29111a3259
Merge branch '1.0.x' 2019-06-12 10:41:11 -07:00
David Lord
8a7d080085
remove codecov 2019-06-12 10:35:35 -07:00
David Lord
46a67b6789
Merge pull request #3261 from pallets/fix-server-name-warnings
fix tests failing with server name warnings
2019-06-12 08:17:25 -07:00
David Lord
dbd4520ccb
fix tests failing with server name warnings
After pallets/werkzeug#1577, mismatched configured and real server
names will show a warning in addition to raising 404. This caused
tests that did this deliberately to fail.

This patch removes the pytest fixture we were using to fail on
warnings, instead using the standard `-Werror` option. This speeds
up the tests by ~3x.
2019-06-10 14:05:33 -07:00
David Lord
d4b688bd03
Merge pull request #3247 from pallets/join-strings
fix string concats left over by black
2019-06-01 12:28:29 -04:00
David Lord
53c893b646
fix string concats left over by black 2019-06-01 09:22:20 -07:00
David Lord
3db4697959
Merge pull request #3246 from pallets/reorder-imports
apply reorder-python-imports pre-commit config
2019-06-01 12:12:49 -04:00
David Lord
43483683b2
apply reorder-python-imports pre-commit config 2019-06-01 09:07:20 -07:00
David Lord
ab8d60d826
Merge pull request #3245 from pallets/src-dir
move to src directory
2019-06-01 11:10:33 -04:00
David Lord
ca278a8694
move to src directory 2019-06-01 08:06:16 -07:00
David Lord
09392e0348
Merge remote-tracking branch 'origin/1.0.x' 2019-06-01 06:53:29 -07:00
David Lord
48d0e86313
Merge pull request #3241 from jon-stumpf/jss-updates
Add pre-commit config for flake8
2019-06-01 09:36:23 -04:00
Jon S. Stumpf
b46f5942a5
address flake8 issues 2019-06-01 06:31:35 -07:00
Jon S. Stumpf
549fed29ea
add pre-commit config for flake8 2019-06-01 09:13:46 -04:00
David Lord
b61cbf8ab4
Merge pull request #3244 from paulgb/master
Clarify documentation about how url_for uses configuration values (#2759)
2019-06-01 08:59:01 -04:00
David Lord
13b689bba6
Merge pull request #3242 from cslecrone/3211-ssl-import
"#3211: Don't require ssl module"
2019-06-01 08:57:06 -04:00
cslecrone
1718f1934c
don't require ssl module for flask cli 2019-05-31 17:27:52 -04:00
David Lord
6369537a49
Merge pull request #3243 from DiegoAlbertoTorres/docs
Guard against missing request context in logging docs.
2019-05-31 16:47:32 -04:00
Paul Butler
a3272941ce Clarify documentation about how url_for uses configuration values (#2759) 2019-05-31 15:33:06 -04:00
Diego Alberto Torres Quintanilla
45b2e7702d Guard against missing request context in logging docs. 2019-05-31 14:54:03 -04:00
David Lord
6e995f2379
Merge pull request #3240 from ultimecia7/docfix
Fix testing documentation to demonstrate using test client with teardown
2019-05-31 14:06:54 -04:00
David Lord
5e15850532
Merge pull request #3232 from lordmauve/environbuilder
Convert make_test_environ_builder into class (fixes #3207)
2019-05-31 13:58:40 -04:00
David Lord
cd4023d9d2
Merge pull request #3237 from scrosby/fix-3218
Move python properties to decorator syntax
2019-05-31 13:44:22 -04:00
ultimecia7
d981cc678a Fix testing documentation to demonstrate using test client with teardown 2019-05-31 13:18:54 -04:00
Daniel Pope
e45370b994 Fix name of kwargs parameter 2019-05-31 18:05:25 +01:00
Daniel Pope
c7f56c5a55 Create json_dumps() method on new EnvironBuilder 2019-05-31 18:05:25 +01:00
Daniel Pope
976dfedaa9 Convert make_test_environ_builder into class (fixes #3207) 2019-05-31 18:05:25 +01:00
David Lord
91e53da054
Merge pull request #3236 from lordmauve/no-cligroup-empty
Do not register empty CLI groups from Blueprint
2019-05-31 13:05:00 -04:00
David Lord
524f9c32c7
Merge pull request #3233 from rtilk89/unused_werkzerg_import
Issue #3226: Remove unused werkzeug datastructure import
2019-05-31 12:58:44 -04:00
David Lord
94e057224c
Merge pull request #3239 from gokcegrbl/GH-3227
Comment on bare except usage in _compat.py
2019-05-31 12:56:43 -04:00
David Lord
52f9aa7ed6
Merge pull request #3235 from johnzeringue/better-return-type-error
Better error message when view return type is not supported
2019-05-31 12:50:59 -04:00
gokcegrbl
1b526c837e Comment on bare except usage in _compat.py
(Fixes pallets/flask#3227)
2019-05-31 16:27:51 +00:00
John Zeringue
8bb7185284 Better error message when view return type is not supported
Before, returning a `bool` from a route caused the error

```
[2019-05-31 10:08:42,216] ERROR in app: Exception on / [GET]
Traceback (most recent call last):
  File "/Users/johnzeringue/Documents/ts-open/flask/flask/app.py", line 2070, in make_response
    rv = self.response_class.force_type(rv, request.environ)
  File "/Users/johnzeringue/Documents/ts-open/flask/env/lib/python3.7/site-packages/werkzeug/wrappers/base_response.py", line 269, in force_type
    response = BaseResponse(*_run_wsgi_app(response, environ))
  File "/Users/johnzeringue/Documents/ts-open/flask/env/lib/python3.7/site-packages/werkzeug/wrappers/base_response.py", line 26, in _run_wsgi_app
    return _run_wsgi_app(*args)
  File "/Users/johnzeringue/Documents/ts-open/flask/env/lib/python3.7/site-packages/werkzeug/test.py", line 1119, in run_wsgi_app
    app_rv = app(environ, start_response)
TypeError: 'bool' object is not callable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/johnzeringue/Documents/ts-open/flask/flask/app.py", line 2393, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/johnzeringue/Documents/ts-open/flask/flask/app.py", line 1906, in full_dispatch_request
    return self.finalize_request(rv)
  File "/Users/johnzeringue/Documents/ts-open/flask/flask/app.py", line 1921, in finalize_request
    response = self.make_response(rv)
  File "/Users/johnzeringue/Documents/ts-open/flask/flask/app.py", line 2078, in make_response
    reraise(TypeError, new_error, sys.exc_info()[2])
  File "/Users/johnzeringue/Documents/ts-open/flask/flask/_compat.py", line 39, in reraise
    raise value.with_traceback(tb)
  File "/Users/johnzeringue/Documents/ts-open/flask/flask/app.py", line 2070, in make_response
    rv = self.response_class.force_type(rv, request.environ)
  File "/Users/johnzeringue/Documents/ts-open/flask/env/lib/python3.7/site-packages/werkzeug/wrappers/base_response.py", line 269, in force_type
    response = BaseResponse(*_run_wsgi_app(response, environ))
  File "/Users/johnzeringue/Documents/ts-open/flask/env/lib/python3.7/site-packages/werkzeug/wrappers/base_response.py", line 26, in _run_wsgi_app
    return _run_wsgi_app(*args)
  File "/Users/johnzeringue/Documents/ts-open/flask/env/lib/python3.7/site-packages/werkzeug/test.py", line 1119, in run_wsgi_app
    app_rv = app(environ, start_response)
TypeError: 'bool' object is not callable
The view function did not return a valid response. The return type must be a string, tuple, Response instance, or WSGI callable, but it was a bool.
```

Now, it returns the more readable

```
[2019-05-31 10:36:19,500] ERROR in app: Exception on / [GET]
Traceback (most recent call last):
  File "/Users/johnzeringue/Documents/ts-open/flask/flask/app.py", line 2400, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/johnzeringue/Documents/ts-open/flask/flask/app.py", line 1907, in full_dispatch_request
    return self.finalize_request(rv)
  File "/Users/johnzeringue/Documents/ts-open/flask/flask/app.py", line 1922, in finalize_request
    response = self.make_response(rv)
  File "/Users/johnzeringue/Documents/ts-open/flask/flask/app.py", line 2085, in make_response
    " {rv.__class__.__name__}.".format(rv=rv))
TypeError: The view function did not return a valid response. The return type must be a string, dict, tuple, Response instance, or WSGI callable, but it was a bool.
```

Fixes #3214
2019-05-31 11:58:49 -04:00
Scott Crosby
55ad09c902 Move python properties to decorator syntax 2019-05-31 10:53:30 -05:00
Daniel Pope
f25b5000fd Do not register empty CLI groups from Blueprint
(Fixes #3224)
2019-05-31 16:49:01 +01:00
David Lord
14e9291380
Merge pull request #3234 from tomowind/issue_3225
#3225: document "del tb"
2019-05-31 10:58:44 -04:00
Sang Min Park
2a97d4a706 #3225: document 2019-05-31 10:55:08 -04:00
Ryan Thielke
cd14adbc1e Issue #3226: Remove unused werkzeug datastructure import 2019-05-31 09:52:53 -05:00
Joshua Bronson
6ac4b93779
Close issues from commit messages in CONTRIBUTING 2019-05-31 09:57:21 -04:00
Joshua Bronson
af1b2ea1d1
Merge pull request #3231 from pallets/jab-precommit
Add pre-commit install-hooks to first-time setup
2019-05-31 09:34:21 -04:00
Joshua Bronson
7ac2cbf63a
Add pre-commit install-hooks to first-time setup 2019-05-31 09:17:52 -04:00
David Lord
1250775a55
Merge pull request #3230 from lordmauve/azure-stylecheck
Enable stylecheck tox run on Azure pipelines (fixes #3228)
2019-05-31 08:21:24 -04:00
Daniel Pope
96b92ff9e8 Enable stylecheck tox run on Azure pipelines 2019-05-31 13:14:15 +01:00
David Lord
240e398c8d
Merge pull request #3229 from lordmauve/style-fix
Fix style issues on master using Black
2019-05-31 07:18:40 -04:00
Daniel Pope
a5ff3cd01b Fix style issues on master using Black 2019-05-31 11:57:28 +01:00