From 8417609aeef3c7756133e6bdc21922c2a8ae8048 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 19:46:12 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/test_annotation_stores.py | 2 +- tests/test_docs.py | 2 +- tests/test_json_config_bokeh.py | 2 +- tests/test_server_bokeh.py | 2 +- tests/test_tileserver.py | 6 +++--- tiatoolbox/annotation/storage.py | 10 +++++----- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/test_annotation_stores.py b/tests/test_annotation_stores.py index 7acbe2e44..01bbdac45 100644 --- a/tests/test_annotation_stores.py +++ b/tests/test_annotation_stores.py @@ -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], diff --git a/tests/test_docs.py b/tests/test_docs.py index ea446737a..20880482b 100644 --- a/tests/test_docs.py +++ b/tests/test_docs.py @@ -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__"} diff --git a/tests/test_json_config_bokeh.py b/tests/test_json_config_bokeh.py index 4461cd431..2c3a16e7b 100644 --- a/tests/test_json_config_bokeh.py +++ b/tests/test_json_config_bokeh.py @@ -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() diff --git a/tests/test_server_bokeh.py b/tests/test_server_bokeh.py index 2289bcbc2..9544abc6d 100644 --- a/tests/test_server_bokeh.py +++ b/tests/test_server_bokeh.py @@ -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() diff --git a/tests/test_tileserver.py b/tests/test_tileserver.py index a3fa610d5..5451f716f 100644 --- a/tests/test_tileserver.py +++ b/tests/test_tileserver.py @@ -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 @@ -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)) @@ -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( diff --git a/tiatoolbox/annotation/storage.py b/tiatoolbox/annotation/storage.py index 8ce05566d..0cd476358 100644 --- a/tiatoolbox/annotation/storage.py +++ b/tiatoolbox/annotation/storage.py @@ -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}, @@ -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, @@ -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, {}, @@ -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, {}, @@ -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, )