forked from orbit-oss/flask
Remove the async helper method
It is better to encourage users to utilise the app ensure_sync method (or the newely added async_to_sync method) so that any extensions that alter these methods take affect throughout the users code. With the helper method users code fix parts of their code to the asgiref async_to_sync ignoring any extension changes.
This commit is contained in:
parent
7f87f3dd93
commit
2889da67cb
3 changed files with 34 additions and 28 deletions
|
|
@ -6,7 +6,6 @@ import pytest
|
|||
from flask import Blueprint
|
||||
from flask import Flask
|
||||
from flask import request
|
||||
from flask.helpers import async_to_sync
|
||||
|
||||
pytest.importorskip("asgiref")
|
||||
|
||||
|
|
@ -136,5 +135,6 @@ def test_async_before_after_request():
|
|||
|
||||
@pytest.mark.skipif(sys.version_info >= (3, 7), reason="should only raise Python < 3.7")
|
||||
def test_async_runtime_error():
|
||||
app = Flask(__name__)
|
||||
with pytest.raises(RuntimeError):
|
||||
async_to_sync(None)
|
||||
app.async_to_sync(None)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue