Commit Graph

33 Commits

Author SHA1 Message Date
pre-commit-ci[bot] a15da89dbb [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-02-07 04:43:02 +00:00
David Lord 82c2e0366c
remove uses of LocalStack 2022-07-08 11:13:09 -07:00
David Lord 426a1e25b7
fix pytest 7 warnings 2022-02-08 12:26:25 -08: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 57d628ca74
remove more compat code 2020-04-04 12:10:00 -07:00
Doron Horwitz 0c0b31a789
get_cookie_name in SessionInterface for easier overriding in SecureCookieSessionInterface 2019-10-12 19:12:27 -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
Jon S. Stumpf b46f5942a5
address flake8 issues 2019-06-01 06:31:35 -07:00
Daniel Pope 976dfedaa9 Convert make_test_environ_builder into class (fixes #3207) 2019-05-31 18:05:25 +01:00
David Baumgold 025589ee76 Reformat with black
https://github.com/python/black
2019-05-06 16:28:58 -04:00
Jarek Piórkowski 9b0bd91195 Correct tests
We've discovered that passing Unicode in Host actually works, except for
test client limitations on Python 2 - and the only things that don't
work are non-printable characters.
2018-11-13 13:09:16 -05:00
Jarek Piórkowski ed9775fb77 Handle errors during create_url_adapter
If create_url_adapter raises (which it can if werkzeug cannot bind
environment, for example on non-ASCII Host header), we handle it as
other routing exceptions rather than raising through.

ref https://github.com/pallets/werkzeug/issues/640
2018-11-12 16:59:09 -05:00
Dave Chevell e08bcf9f97 Fix #2935: Copy current session object in copy_current_request_context (#2936)
Add session to RequestContext.copy()
2018-11-03 20:32:24 -07:00
David Lord 310fbfcf64
revert copyright year to project start
add copyright header to files
2018-02-08 12:43:30 -08:00
Rene A. Zelaya d29dbe14cf Correcting name of GreenletContextCopying test class (to start with 'Test'), making it extend object, and also having the test methods in it include 'self' as first argument. 2017-05-23 16:51:50 -07:00
Rene A. Zelaya 2eb28165a9 Bundling 'test_greenlet_context_copying' functions into a new class in tests/test_reqctx.py. 2017-05-23 16:45:11 -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
David Lord 13754b6d11
ensure error while opening session pops context
errors will be handled by the app error handlers
closes #1538, closes #1528
2017-04-22 13:57:04 -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
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
Parkayun 33534bb4a9 Happy New Year 2015 2015-01-02 11:35:00 +09:00
Markus Unterwaditzer c6795eb626 Remove useless unittest imports 2014-09-21 16:47:38 +02:00
Markus Unterwaditzer af4cb0ff2b Remove flask superclass 2014-09-11 22:09:51 +02:00
Markus Unterwaditzer af41dbe0c4 Remove useless classes 2014-09-11 22:09:51 +02:00
Markus Unterwaditzer 5da2c00419 Rewrite assertion methods 2014-09-11 22:09:51 +02:00
Markus Unterwaditzer 8fa5e32d9a Tests pass now. 2014-09-11 22:09:50 +02:00
Markus Unterwaditzer 961db8ad72 Made tests recognizable 2014-09-11 22:09:50 +02:00