Commit graph

26 commits

Author SHA1 Message Date
David Lord
8b9128ee06 cleaner message when CLI can't load app
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.
2020-07-30 18:36:55 -07:00
David Lord
296ef35943 remove unused module docstrings 2020-04-04 12:28:08 -07:00
David Lord
f5038c4c39 f-strings everywhere 2020-04-04 12:10:00 -07:00
David Lord
67bb43b738 apply pyupgrade 2020-04-04 12:10:00 -07:00
David Lord
ff0c92a1c7 Merge branch '1.0.x' 2019-06-23 16:57:52 -07:00
David Lord
e066e9f9e3 standardize license and copyright 2019-06-22 13:09:09 -07:00
David Lord
43f66251ad Merge branch '1.0.x' 2019-06-12 10:41:11 -07:00
David Lord
090bc4470e 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
e66fe2e8e7 apply reorder-python-imports pre-commit config 2019-06-01 09:07:20 -07:00
David Baumgold
85ce588b3b Reformat with black
https://github.com/python/black
2019-05-06 16:28:58 -04:00
David Lord
f1d2226f42 don't use Flask(__name__) in conftest 2018-02-28 06:50:49 -08:00
David Lord
aa4db37a7f revert copyright year to project start
add copyright header to files
2018-02-08 12:43:30 -08:00
David Lord
8dfb664336 reset standard os env after each test 2018-01-10 13:53:45 -08:00
Chuan Ma
f31297dfe3 pytest.yield_fixture deprecated in pytest 3.0+.
It's suggested to use pytest.fixture directly,
and flask already requires 'pytest>=3'.
2017-08-14 10:25:24 -04:00
David Lord
d590d6024d clean up secret key docs
consistent key across docs and examples
consistent key across tests, set in conftest
2017-06-28 07:58:06 -07:00
Christian Stade-Schuldt
2158fe3e12 DRYing up the test suite using pytest fixtures (#2306)
* 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
2017-05-23 15:18:39 -07:00
bovarysme
e94527717e Use the yield syntax in pytest's fixtures 2017-05-23 18:21:29 +02:00
Markus Unterwaditzer
0265d02b19 Eliminate some resource warnings 2016-06-03 14:29:27 +02:00
Markus Unterwaditzer
d6ffc570d2 Use recwarn everywhere
...instead of custom fixture. Also assert that no warnings are left over
after the test.
2016-06-03 13:59:47 +02:00
Parkayun
e05771ff60 Happy New Year 2015 2015-01-02 11:35:00 +09:00
Petr Zemek
cbd4f414c6 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
Markus Unterwaditzer
0b992484dd Testsuite is not a package 2014-09-11 22:09:52 +02:00
Markus Unterwaditzer
19f6a8af4c Rename fixture apps_tmpdir 2014-09-11 22:09:52 +02:00
Markus Unterwaditzer
9dd95d8dbb Init global test_apps explicitly 2014-09-11 22:09:51 +02:00
Markus Unterwaditzer
b33bb13c22 WIP 2014-09-11 22:09:51 +02:00
Markus Unterwaditzer
a21721a2ba Move fixtures 2014-09-11 22:09:51 +02:00