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
|
|
@ -41,7 +41,7 @@ def test_inspect_cli_writes_to_file(app_client):
|
|||
|
||||
def test_serve_with_inspect_file_prepopulates_table_counts_cache():
|
||||
inspect_data = {"fixtures": {"tables": {"hithere": {"count": 44}}}}
|
||||
for client in make_app_client(inspect_data=inspect_data, is_immutable=True):
|
||||
with make_app_client(inspect_data=inspect_data, is_immutable=True) as client:
|
||||
assert inspect_data == client.ds.inspect_data
|
||||
db = client.ds.databases["fixtures"]
|
||||
assert {"hithere": 44} == db.cached_table_counts
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue