mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
datasette.client internal requests mechanism
Closes #943 * Datasette now requires httpx>=0.15 * Support OPTIONS without 500, closes #1001 * Added internals tests for datasette.client methods * Datasette's own test mechanism now uses httpx to simulate requests * Tests simulate HTTP 1.1 now * Added base_url in a bunch more places * Mark some tests as xfail - will remove that when new httpx release ships: #1005
This commit is contained in:
parent
7249ac5ca0
commit
8f97b9b58e
18 changed files with 163 additions and 100 deletions
|
|
@ -144,9 +144,7 @@ def make_app_client(
|
|||
template_dir=template_dir,
|
||||
)
|
||||
ds.sqlite_functions.append(("sleep", 1, lambda n: time.sleep(float(n))))
|
||||
client = TestClient(ds.app())
|
||||
client.ds = ds
|
||||
yield client
|
||||
yield TestClient(ds)
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
|
|
@ -158,9 +156,7 @@ def app_client():
|
|||
@pytest.fixture(scope="session")
|
||||
def app_client_no_files():
|
||||
ds = Datasette([])
|
||||
client = TestClient(ds.app())
|
||||
client.ds = ds
|
||||
yield client
|
||||
yield TestClient(ds)
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue