kopia lustrzana https://github.com/simonw/datasette
Fixed pytest warning about TestClient class
rodzic
b314e088c5
commit
450d2e2896
|
@ -3,7 +3,7 @@ import pytest
|
|||
import sqlite3
|
||||
|
||||
from datasette.app import Datasette
|
||||
from .fixtures import TestClient
|
||||
from .fixtures import TestClient as _TestClient
|
||||
|
||||
PLUGIN = """
|
||||
from datasette import hookimpl
|
||||
|
@ -76,7 +76,7 @@ def config_dir_client(tmp_path_factory):
|
|||
)
|
||||
|
||||
ds = Datasette([], config_dir=config_dir)
|
||||
client = TestClient(ds.app())
|
||||
client = _TestClient(ds.app())
|
||||
client.ds = ds
|
||||
yield client
|
||||
|
||||
|
@ -137,7 +137,7 @@ def test_metadata_yaml(tmp_path_factory, filename):
|
|||
config_dir = tmp_path_factory.mktemp("yaml-config-dir")
|
||||
(config_dir / filename).write_text("title: Title from metadata", "utf-8")
|
||||
ds = Datasette([], config_dir=config_dir)
|
||||
client = TestClient(ds.app())
|
||||
client = _TestClient(ds.app())
|
||||
client.ds = ds
|
||||
response = client.get("/-/metadata.json")
|
||||
assert 200 == response.status
|
||||
|
|
|
@ -4,7 +4,7 @@ from .fixtures import (
|
|||
make_app_client,
|
||||
TABLES,
|
||||
TEMP_PLUGIN_SECRET_FILE,
|
||||
TestClient,
|
||||
TestClient as _TestClient,
|
||||
) # noqa
|
||||
from datasette.app import Datasette
|
||||
from datasette.plugins import get_plugins, DEFAULT_PLUGINS
|
||||
|
@ -293,7 +293,7 @@ def view_names_client(tmp_path_factory):
|
|||
db_path = str(tmpdir / "fixtures.db")
|
||||
conn = sqlite3.connect(db_path)
|
||||
conn.executescript(TABLES)
|
||||
return TestClient(
|
||||
return _TestClient(
|
||||
Datasette(
|
||||
[db_path], template_dir=str(templates), plugins_dir=str(plugins)
|
||||
).app()
|
||||
|
|
Ładowanie…
Reference in New Issue