mirror of
https://github.com/simonw/datasette.git
synced 2026-06-06 09:07:00 +02:00
Drop redundant _ds_client global now that ds_client is session-scoped
Session-scoped fixtures are cached per worker by pytest itself, so the manual _ds_client module global is no longer needed. Refs #2692 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
c9a7dc9be2
commit
b3001c1e5a
1 changed files with 1 additions and 9 deletions
|
|
@ -28,9 +28,6 @@ UNDOCUMENTED_PERMISSIONS = {
|
|||
"view_document",
|
||||
}
|
||||
|
||||
_ds_client = None
|
||||
|
||||
|
||||
def wait_until_responds(url, timeout=5.0, client=httpx, **kwargs):
|
||||
start = time.time()
|
||||
while time.time() - start < timeout:
|
||||
|
|
@ -60,10 +57,6 @@ async def ds_client():
|
|||
from .fixtures import CONFIG, METADATA, PLUGINS_DIR
|
||||
import secrets
|
||||
|
||||
global _ds_client
|
||||
if _ds_client is not None:
|
||||
return _ds_client
|
||||
|
||||
ds = Datasette(
|
||||
metadata=METADATA,
|
||||
config=CONFIG,
|
||||
|
|
@ -95,8 +88,7 @@ async def ds_client():
|
|||
|
||||
await db.execute_write_fn(prepare)
|
||||
await ds.invoke_startup()
|
||||
_ds_client = ds.client
|
||||
return _ds_client
|
||||
return ds.client
|
||||
|
||||
|
||||
def pytest_report_header(config):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue