From 2d1ddd8bffa838a56f7c9c23ed6b686501e4c6ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Fri, 16 Aug 2024 10:26:56 +0200 Subject: [PATCH] Update pre-commit --- .pre-commit-config.yaml | 2 +- holonote/tests/conftest.py | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0aff0b39..07798d0f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,7 +20,7 @@ repos: - id: check-json - id: detect-private-key - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.5.5 + rev: v0.6.0 hooks: - id: ruff files: holonote/ diff --git a/holonote/tests/conftest.py b/holonote/tests/conftest.py index 49d2bb4b..e2c70252 100644 --- a/holonote/tests/conftest.py +++ b/holonote/tests/conftest.py @@ -45,7 +45,7 @@ def pytest_collection_modifyitems(config, items): items[:] = selected -@pytest.fixture() +@pytest.fixture def conn_sqlite_uuid(tmp_path) -> Iterator[SQLiteDB]: conn = SQLiteDB(filename=str(tmp_path / "test.db"), primary_key=UUIDHexStringKey()) yield conn @@ -55,7 +55,7 @@ def conn_sqlite_uuid(tmp_path) -> Iterator[SQLiteDB]: conn.con.close() -@pytest.fixture() +@pytest.fixture def annotator_range1d(conn_sqlite_uuid) -> Annotator: anno = Annotator( {"TIME": np.datetime64}, @@ -65,7 +65,7 @@ def annotator_range1d(conn_sqlite_uuid) -> Annotator: return anno -@pytest.fixture() +@pytest.fixture def annotator_point1d(conn_sqlite_uuid) -> Annotator: anno = Annotator( {"TIME": (np.datetime64, "point")}, @@ -75,7 +75,7 @@ def annotator_point1d(conn_sqlite_uuid) -> Annotator: return anno -@pytest.fixture() +@pytest.fixture def annotator_range2d(conn_sqlite_uuid) -> Annotator: anno = Annotator( {"x": float, "y": float}, @@ -85,7 +85,7 @@ def annotator_range2d(conn_sqlite_uuid) -> Annotator: return anno -@pytest.fixture() +@pytest.fixture def annotator_point2d(conn_sqlite_uuid) -> Annotator: anno = Annotator( {"x": (float, "point"), "y": (float, "point")}, @@ -95,7 +95,7 @@ def annotator_point2d(conn_sqlite_uuid) -> Annotator: return anno -@pytest.fixture() +@pytest.fixture def multiple_region_annotator(conn_sqlite_uuid) -> Annotator: return Annotator( {"TIME": np.datetime64}, @@ -105,7 +105,7 @@ def multiple_region_annotator(conn_sqlite_uuid) -> Annotator: ) -@pytest.fixture() +@pytest.fixture def multiple_annotators(conn_sqlite_uuid) -> Annotator: return Annotator( {"TIME": np.datetime64, "x": float, "y": float}, @@ -114,7 +114,7 @@ def multiple_annotators(conn_sqlite_uuid) -> Annotator: ) -@pytest.fixture() +@pytest.fixture def multiple_fields_annotator(conn_sqlite_uuid) -> Annotator: conn_sqlite_uuid.fields = ["field1", "field2"] anno = Annotator( @@ -125,20 +125,20 @@ def multiple_fields_annotator(conn_sqlite_uuid) -> Annotator: return anno -@pytest.fixture() +@pytest.fixture def element_range1d() -> hv.Curve: time = pd.date_range("2020-01-01", "2020-01-10", freq="D").to_numpy() return hv.Curve(time, kdims=["TIME"]) -@pytest.fixture() +@pytest.fixture def element_range2d() -> hv.Image: x = np.arange(10) xy = x[:, np.newaxis] * x return hv.Image(xy, kdims=["x", "y"]) -@pytest.fixture() +@pytest.fixture def cat_annotator(conn_sqlite_uuid) -> Annotator: # Initialize annotator annotator = Annotator(