[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
223e686266
commit
dbf5fde778
1 changed files with 9 additions and 4 deletions
|
|
@ -6,7 +6,8 @@ import pytest
|
||||||
from flask import Blueprint
|
from flask import Blueprint
|
||||||
from flask import Flask
|
from flask import Flask
|
||||||
from flask import request
|
from flask import request
|
||||||
from flask.views import View, MethodView
|
from flask.views import MethodView
|
||||||
|
from flask.views import View
|
||||||
|
|
||||||
pytest.importorskip("asgiref")
|
pytest.importorskip("asgiref")
|
||||||
|
|
||||||
|
|
@ -69,13 +70,17 @@ def _async_app():
|
||||||
async def post(self):
|
async def post(self):
|
||||||
return "POST"
|
return "POST"
|
||||||
|
|
||||||
app.add_url_rule("/async_methodview", view_func=AsyncMethodView.as_view("async_methodview"))
|
app.add_url_rule(
|
||||||
|
"/async_methodview", view_func=AsyncMethodView.as_view("async_methodview")
|
||||||
|
)
|
||||||
|
|
||||||
return app
|
return app
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(sys.version_info < (3, 7), reason="requires Python >= 3.7")
|
@pytest.mark.skipif(sys.version_info < (3, 7), reason="requires Python >= 3.7")
|
||||||
@pytest.mark.parametrize("path", ["/", "/home", "/bp/", "async_view", "async_methodview"])
|
@pytest.mark.parametrize(
|
||||||
|
"path", ["/", "/home", "/bp/", "async_view", "async_methodview"]
|
||||||
|
)
|
||||||
def test_async_route(path, async_app):
|
def test_async_route(path, async_app):
|
||||||
test_client = async_app.test_client()
|
test_client = async_app.test_client()
|
||||||
response = test_client.get(path)
|
response = test_client.get(path)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue