Skip to content

Commit b3001c1

Browse files
simonwclaude
andcommitted
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>
1 parent c9a7dc9 commit b3001c1

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

tests/conftest.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@
2828
"view_document",
2929
}
3030

31-
_ds_client = None
32-
33-
3431
def wait_until_responds(url, timeout=5.0, client=httpx, **kwargs):
3532
start = time.time()
3633
while time.time() - start < timeout:
@@ -60,10 +57,6 @@ async def ds_client():
6057
from .fixtures import CONFIG, METADATA, PLUGINS_DIR
6158
import secrets
6259

63-
global _ds_client
64-
if _ds_client is not None:
65-
return _ds_client
66-
6760
ds = Datasette(
6861
metadata=METADATA,
6962
config=CONFIG,
@@ -95,8 +88,7 @@ def prepare(conn):
9588

9689
await db.execute_write_fn(prepare)
9790
await ds.invoke_startup()
98-
_ds_client = ds.client
99-
return _ds_client
91+
return ds.client
10092

10193

10294
def pytest_report_header(config):

0 commit comments

Comments
 (0)