aboutsummaryrefslogtreecommitdiff
path: root/tests/incite/collections/test_df_collection_base.py
diff options
context:
space:
mode:
authorMax Nanis2026-03-09 06:27:14 -0400
committerMax Nanis2026-03-09 06:27:14 -0400
commit2f92429a68ec7209059d2d18fe67964c8dd57cf2 (patch)
tree641358598982860f6452d27a74cae809b0d2d430 /tests/incite/collections/test_df_collection_base.py
parentce291a165fab6b6dc9f053c7b75a699d0fdf389f (diff)
downloadgeneralresearch-2f92429a68ec7209059d2d18fe67964c8dd57cf2.tar.gz
generalresearch-2f92429a68ec7209059d2d18fe67964c8dd57cf2.zip
Simple typing changes, Ruff import formatter. p3
Diffstat (limited to 'tests/incite/collections/test_df_collection_base.py')
-rw-r--r--tests/incite/collections/test_df_collection_base.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/tests/incite/collections/test_df_collection_base.py b/tests/incite/collections/test_df_collection_base.py
index 5aaa729..10f025b 100644
--- a/tests/incite/collections/test_df_collection_base.py
+++ b/tests/incite/collections/test_df_collection_base.py
@@ -1,15 +1,19 @@
from datetime import datetime, timezone
+from typing import TYPE_CHECKING
import pandas as pd
import pytest
from pandera import DataFrameSchema
from generalresearch.incite.collections import (
- DFCollectionType,
DFCollection,
+ DFCollectionType,
)
from test_utils.incite.conftest import mnt_filepath
+if TYPE_CHECKING:
+ from generalresearch.incite.base import GRLDatasets
+
df_collection_types = [e for e in DFCollectionType if e is not DFCollectionType.TEST]
@@ -20,7 +24,7 @@ class TestDFCollectionBase:
"""
- def test_init(self, mnt_filepath, df_coll_type):
+ def test_init(self, mnt_filepath: "GRLDatasets", df_coll_type: DFCollectionType):
"""Try to initialize the DFCollection with various invalid parameters"""
with pytest.raises(expected_exception=ValueError) as cm:
DFCollection(archive_path=mnt_filepath.data_src)
@@ -42,7 +46,7 @@ class TestDFCollectionBase:
class TestDFCollectionBaseProperties:
@pytest.mark.skip
- def test_df_collection_items(self, mnt_filepath, df_coll_type):
+ def test_df_collection_items(self, mnt_filepath: "GRLDatasets", df_coll_type):
instance = DFCollection(
data_type=df_coll_type,
start=datetime(year=1800, month=1, day=1, tzinfo=timezone.utc),
@@ -54,7 +58,7 @@ class TestDFCollectionBaseProperties:
assert len(instance.interval_range) == len(instance.items)
assert len(instance.items) == 366
- def test_df_collection_progress(self, mnt_filepath, df_coll_type):
+ def test_df_collection_progress(self, mnt_filepath: "GRLDatasets", df_coll_type):
instance = DFCollection(
data_type=df_coll_type,
start=datetime(year=1800, month=1, day=1, tzinfo=timezone.utc),
@@ -67,7 +71,7 @@ class TestDFCollectionBaseProperties:
assert isinstance(instance.progress, pd.DataFrame)
assert instance.progress.shape == (366, 6)
- def test_df_collection_schema(self, mnt_filepath, df_coll_type):
+ def test_df_collection_schema(self, mnt_filepath: "GRLDatasets", df_coll_type):
instance1 = DFCollection(
data_type=DFCollectionType.WALL, archive_path=mnt_filepath.data_src
)
@@ -84,7 +88,7 @@ class TestDFCollectionBaseProperties:
class TestDFCollectionBaseMethods:
@pytest.mark.skip
- def test_initial_load(self, mnt_filepath, thl_web_rr):
+ def test_initial_load(self, mnt_filepath: "GRLDatasets", thl_web_rr):
instance = DFCollection(
pg_config=thl_web_rr,
data_type=DFCollectionType.USER,