When loading the app fails for the --help command, only the error
message is shown, then the help text. The full traceback is shown for
other exceptions. Also show the message when loading fails while
getting a command, instead of only "command not found". The error
message goes to stderr to match other error behavior, and is in red
with an extra newline to make it more obvious next to the help text.
Also fixes an issue with the test_apps fixture that caused an imported
app to still be importable after the test was over and the path was
reset. Now the module cache is reset as well.
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.
* add fixtures to conftest.py
* use fixtures in test_appctx.py
* use fixtures in test_blueprints.py
* use fixtures in test_depreciations.py
* use fixtures in test_regressions.py
* use fixtures in test_reqctx.py
* use fixtures in test_templating.py
* use fixtures in test_user_error_handler.py
* use fixtures in test_views.py
* use fixtures in test_basics.py
* use fixtures in test_helpers.py
* use fixtures in test_testing.py
* update conftest.py
* make docstrings PEP-257 compliant
* cleanup
* switch dictonary format
* use pytest parameterization for test_json_as_unicode