[pre-commit.ci lite] apply automatic fixes
This commit is contained in:
parent
1fc69bd3f4
commit
2a314b5e81
1 changed files with 8 additions and 6 deletions
|
|
@ -1972,13 +1972,16 @@ def test_app_freed_on_zero_refcount():
|
||||||
|
|
||||||
def test_sync_view_functions_cache(app, client):
|
def test_sync_view_functions_cache(app, client):
|
||||||
"""Test that the _sync_view_functions cache is populated and used."""
|
"""Test that the _sync_view_functions cache is populated and used."""
|
||||||
|
|
||||||
@app.route("/test")
|
@app.route("/test")
|
||||||
def test_view():
|
def test_view():
|
||||||
return "Hello"
|
return "Hello"
|
||||||
|
|
||||||
import unittest.mock
|
import unittest.mock
|
||||||
|
|
||||||
with unittest.mock.patch.object(app, 'ensure_sync', wraps=app.ensure_sync) as mock_ensure_sync:
|
with unittest.mock.patch.object(
|
||||||
|
app, "ensure_sync", wraps=app.ensure_sync
|
||||||
|
) as mock_ensure_sync:
|
||||||
# First request should call ensure_sync
|
# First request should call ensure_sync
|
||||||
response = client.get("/test")
|
response = client.get("/test")
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
|
|
@ -2001,4 +2004,3 @@ def test_sync_view_functions_cache(app, client):
|
||||||
response = client.get("/test")
|
response = client.get("/test")
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
assert response.data == b"Hello"
|
assert response.data == b"Hello"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue