Commit graph

31 commits

Author SHA1 Message Date
David Lord
0a00e1b608
use tmp_path instead of tmpdir 2023-05-02 10:38:27 -07:00
David Lord
1d7281fe07
remove egg test
eggs aren't supported, and Python 3.12 removes setuptools
2023-05-02 09:53:31 -07:00
David Lord
6650764e97
remove previously deprecated code 2023-02-23 08:35:16 -08:00
David Lord
82c2e0366c
remove uses of LocalStack 2022-07-08 11:13:09 -07:00
David Lord
ab1fbef29a
prefer --app over FLASK_APP in docs 2022-06-17 09:26:26 -07:00
David Lord
253570784c
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
f2f027d1fb
remove unused module docstrings 2020-04-04 12:28:08 -07:00
David Lord
2ae740dd49
f-strings everywhere 2020-04-04 12:10:00 -07:00
David Lord
524fd0bc8c
apply pyupgrade 2020-04-04 12:10:00 -07:00
David Lord
1351d0a565
Merge branch '1.0.x' 2019-06-23 16:57:52 -07:00
David Lord
e666f7a69c
standardize license and copyright 2019-06-22 13:09:09 -07:00
David Lord
29111a3259
Merge branch '1.0.x' 2019-06-12 10:41:11 -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
43483683b2
apply reorder-python-imports pre-commit config 2019-06-01 09:07:20 -07:00
David Baumgold
025589ee76 Reformat with black
https://github.com/python/black
2019-05-06 16:28:58 -04:00
David Lord
5f42989ce3
don't use Flask(__name__) in conftest 2018-02-28 06:50:49 -08:00
David Lord
310fbfcf64
revert copyright year to project start
add copyright header to files
2018-02-08 12:43:30 -08:00
David Lord
8bdf820e9b
reset standard os env after each test 2018-01-10 13:53:45 -08:00
Chuan Ma
5888d76342 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
465922e5f1
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
5b0b9717da 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
5963cb5a51 Use the yield syntax in pytest's fixtures 2017-05-23 18:21:29 +02:00
Markus Unterwaditzer
6c359e0f53 Eliminate some resource warnings 2016-06-03 14:29:27 +02:00
Markus Unterwaditzer
d393597c50 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
33534bb4a9 Happy New Year 2015 2015-01-02 11:35:00 +09: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
Markus Unterwaditzer
192da325f8 Testsuite is not a package 2014-09-11 22:09:52 +02:00
Markus Unterwaditzer
77d887526d Rename fixture apps_tmpdir 2014-09-11 22:09:52 +02:00
Markus Unterwaditzer
861aa0db1f Init global test_apps explicitly 2014-09-11 22:09:51 +02:00
Markus Unterwaditzer
d0cf5ef394 WIP 2014-09-11 22:09:51 +02:00
Markus Unterwaditzer
b1c0951ad6 Move fixtures 2014-09-11 22:09:51 +02:00