Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Aug 19, 2024
1 parent d27ef88 commit 8417609
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion tests/test_annotation_stores.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def sample_triangle() -> Polygon:
return Polygon([(0, 0), (1, 1), (2, 0)])


@pytest.fixture()
@pytest.fixture
def fill_store(
cell_grid: list[Polygon],
points_grid: list[Point],
Expand Down
2 changes: 1 addition & 1 deletion tests/test_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from collections.abc import Generator


@pytest.fixture()
@pytest.fixture
def source_files(root_path: Path) -> Generator:
"""Recursively yield source files from the project."""
ignore = {"__pycache__"}
Expand Down
2 changes: 1 addition & 1 deletion tests/test_json_config_bokeh.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def annotation_path(data_path: dict[str, Path]) -> dict[str, Path]:
return data_path


@pytest.fixture()
@pytest.fixture
def bk_session(data_path: dict[str, Path]) -> ClientSession:
"""Create a bokeh session."""
run_tileserver()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_server_bokeh.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def annotation_path(data_path: dict[str, Path]) -> dict[str, Path]:
return data_path


@pytest.fixture()
@pytest.fixture
def bk_session(data_path: dict[str, Path]) -> ClientSession:
"""Create a bokeh session."""
run_tileserver()
Expand Down
6 changes: 3 additions & 3 deletions tests/test_tileserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def _fill_store(
return _fill_store


@pytest.fixture()
@pytest.fixture
def app(remote_sample: Callable, tmp_path: Path) -> TileServer:
"""Create a testing TileServer WSGI app."""
# Make a low-res .jpg of the right shape to be used as
Expand Down Expand Up @@ -122,7 +122,7 @@ def app(remote_sample: Callable, tmp_path: Path) -> TileServer:
return app


@pytest.fixture()
@pytest.fixture
def app_alt(fill_store: Callable) -> TileServer:
"""Create a testing TileServer WSGI app, with a different setup."""
sample_slide = WSIReader.open(np.zeros((1000, 1000, 3), dtype=np.uint8))
Expand All @@ -147,7 +147,7 @@ def app_alt(fill_store: Callable) -> TileServer:
return app


@pytest.fixture()
@pytest.fixture
def empty_app() -> TileServer:
"""Create a testing TileServer WSGI app with no layers."""
app = TileServer(
Expand Down
10 changes: 5 additions & 5 deletions tiatoolbox/annotation/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ def _eval_where(
return True
if isinstance(predicate, str):
return bool(
eval( # skipcq: PYL-W0123, # noqa: PGH001, S307
eval( # skipcq: PYL-W0123, # noqa: S307
predicate,
PY_GLOBALS,
{"props": properties},
Expand Down Expand Up @@ -1513,7 +1513,7 @@ def select_values(

if isinstance(select, str):
py_locals = {"props": annotation.properties}
return eval( # skipcq: PYL-W0123, # noqa: PGH001, S307
return eval( # skipcq: PYL-W0123, # noqa: S307
select,
PY_GLOBALS,
py_locals,
Expand Down Expand Up @@ -2817,7 +2817,7 @@ def _initialize_query_string_parameters(
query_parameters["where"] = where
# Predicate is a string
if isinstance(where, str):
sql_predicate = eval( # skipcq: PYL-W0123, # noqa: PGH001, S307
sql_predicate = eval( # skipcq: PYL-W0123, # noqa: S307
where,
SQL_GLOBALS,
{},
Expand Down Expand Up @@ -3427,7 +3427,7 @@ def pquery(
return_columns.append("[key]")
if is_str_query and not is_star_query:
select = cast(str, select)
select_names = eval( # skipcq: PYL-W0123, # noqa: PGH001, S307
select_names = eval( # skipcq: PYL-W0123, # noqa: S307
select,
SQL_GLOBALS,
{},
Expand Down Expand Up @@ -3855,7 +3855,7 @@ def create_index(
if not isinstance(where, str):
msg = f"Invalid type for `where` ({type(where)})."
raise TypeError(msg)
sql_predicate = eval( # skipcq: PYL-W0123, # noqa: PGH001, S307
sql_predicate = eval( # skipcq: PYL-W0123, # noqa: S307
where,
SQL_GLOBALS,
)
Expand Down

0 comments on commit 8417609

Please sign in to comment.