Commit Graph

17 Commits

Author SHA1 Message Date
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
Randy Liou d8d712a0de Add coverage for Blueprint teardown request method
Test the following methods in the Blueprint object: teardown_request,
and teardown_app_request.
This PR increases the coverage of blueprint module by 3%.
2017-05-22 16:58:04 -07:00
Randy Liou a690ae27a3 Add coverage for Blueprint request process methods
Add test to cover following methodss to the Blueprint object:
before_request, after_request, before_app_request,
before_app_first_request, after_app_request.
This PR increases the coverage of flask.blueprints by 6%.
2017-05-22 16:58:04 -07:00
Randy Liou 7ce01ab9b4 Add coverage for Blueprint.add_app_template_global
This tests the Blueprint.add_app_template_global mothod, which internally
calls the Blueprint.app_template_global method. The methods are used to
registering a function to the jinja template environment.
This PR increases the test coverage for module flask.blueprint by 4%.
2017-05-22 14:33:58 -07:00
David Lord e706b5e544 Merge pull request #2298 from dawran6/test-bp-context
Add coverage for Blueprints.(app_)context_processor
2017-05-22 14:01:59 -07:00
Randy Liou 136dbf7de0 Add coverage for Blueprints.(app_)context_processor
Test both context_processor and app_context_processor functions.
Two context parameters are added into the context: one added to
the blueprint locally; another added to the app globally. The test
asserts the behaviors in both blueprint scope and the app scope.
The coverage for flask.blueprints is increased by 3%.
2017-05-22 13:09:22 -07:00
Randy Liou 9fddecd4d9 Add coverage for Blueprint.app_errorhandler
This test case registers an application-wise error handler from
a Blueprint. Verifies the error handler by aborting the flask app
from the application itself as well as from another registered
Blueprint.
2017-05-22 12:00:04 -07:00
Randy Liou 954b7ef7bb Enhance code coverage for Blueprint.endpoint
Add basic test for the endpoint decorator for the Blueprint object.
2016-06-03 16:02:45 -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
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 861aa0db1f Init global test_apps explicitly 2014-09-11 22:09:51 +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