-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add testing for Flask nested blueprints. (#238) * Add testing for nested blueprints. * Remove comment in tox.ini. * Add pytest xfails for broken exception handling tests. * Add flask version checks for nested blueprints. * Update error handler instrumentation point for Flask v2 (#239) * Update error handler instrumentation point for flask v2. * Reformat framework_flask.py file. * Remove pytest xfails. * Remove outdated flask versioning checks in tests, * Flask async view tests (#240) * Flask async view testing * Add skip logic for older versions of flask * Merge skip logic together for blueprints * Fix extras on master branch for flask * Remove old flask version skip logic * Restore required flask version testing (#244) * Restore required flask version testing * Fix version python 2 syntax issues * Remove py36 from latest flask tests * Separate async support skipping for pypy (#248) Co-authored-by: Uma Annamalai <[email protected]>
- Loading branch information
1 parent
9c007df
commit e2e914c
Showing
13 changed files
with
372 additions
and
243 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright 2010 New Relic, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import webtest | ||
from _test_application import application | ||
|
||
from conftest import async_handler_support | ||
|
||
# Async handlers only supported in Flask >2.0.0 | ||
if async_handler_support: | ||
@application.route('/async') | ||
async def async_page(): | ||
return 'ASYNC RESPONSE' | ||
|
||
_test_application = webtest.TestApp(application) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Copyright 2010 New Relic, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import webtest | ||
import flask.views | ||
|
||
from _test_views import app | ||
|
||
from conftest import async_handler_support | ||
|
||
# Async view support added in flask v2 | ||
if async_handler_support: | ||
class TestAsyncView(flask.views.View): | ||
async def dispatch_request(self): | ||
return "ASYNC VIEW RESPONSE" | ||
|
||
class TestAsyncMethodView(flask.views.MethodView): | ||
async def get(self): | ||
return "ASYNC METHODVIEW GET RESPONSE" | ||
|
||
app.add_url_rule("/async_view", view_func=TestAsyncView.as_view("test_async_view")) | ||
app.add_url_rule( | ||
"/async_methodview", | ||
view_func=TestAsyncMethodView.as_view("test_async_methodview"), | ||
) | ||
|
||
_test_application = webtest.TestApp(app) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.