forked from orbit-oss/flask
fix pytest 7 warnings
This commit is contained in:
parent
6f7d99ce4b
commit
426a1e25b7
2 changed files with 16 additions and 4 deletions
|
|
@ -1,3 +1,5 @@
|
|||
import warnings
|
||||
|
||||
import pytest
|
||||
|
||||
import flask
|
||||
|
|
@ -81,7 +83,10 @@ def test_proper_test_request_context(app):
|
|||
)
|
||||
|
||||
# suppress Werkzeug 0.15 warning about name mismatch
|
||||
with pytest.warns(None):
|
||||
with warnings.catch_warnings():
|
||||
warnings.filterwarnings(
|
||||
"ignore", "Current server name", UserWarning, "flask.app"
|
||||
)
|
||||
with app.test_request_context(
|
||||
"/", environ_overrides={"HTTP_HOST": "localhost"}
|
||||
):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue