mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Nicer pattern for make_app_client() in tests, closes #395
This commit is contained in:
parent
5ed2853cf3
commit
abc7339124
7 changed files with 56 additions and 42 deletions
|
|
@ -229,9 +229,9 @@ def test_plugins_asgi_wrapper(app_client):
|
|||
|
||||
|
||||
def test_plugins_extra_template_vars(restore_working_directory):
|
||||
for client in make_app_client(
|
||||
with make_app_client(
|
||||
template_dir=str(pathlib.Path(__file__).parent / "test_templates")
|
||||
):
|
||||
) as client:
|
||||
response = client.get("/-/metadata")
|
||||
assert response.status == 200
|
||||
extra_template_vars = json.loads(
|
||||
|
|
@ -254,9 +254,9 @@ def test_plugins_extra_template_vars(restore_working_directory):
|
|||
|
||||
|
||||
def test_plugins_async_template_function(restore_working_directory):
|
||||
for client in make_app_client(
|
||||
with make_app_client(
|
||||
template_dir=str(pathlib.Path(__file__).parent / "test_templates")
|
||||
):
|
||||
) as client:
|
||||
response = client.get("/-/metadata")
|
||||
assert response.status == 200
|
||||
extra_from_awaitable_function = (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue