Skip to content

Commit

Permalink
Fixed pytest warning about TestClient class
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed May 4, 2020
1 parent b314e08 commit 450d2e2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions tests/test_config_dir.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sqlite3

from datasette.app import Datasette
from .fixtures import TestClient
from .fixtures import TestClient as _TestClient

PLUGIN = """
from datasette import hookimpl
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/test_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
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
Expand Down Expand Up @@ -293,7 +293,7 @@ def extra_template_vars(view_name):
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()
Expand Down

0 comments on commit 450d2e2

Please sign in to comment.