From f7b7b9dbe1bb5e57e4d0cf7d006416ef16cd5a56 Mon Sep 17 00:00:00 2001 From: Pete Gadomski Date: Tue, 21 Feb 2023 09:25:10 -0700 Subject: [PATCH] refactor, tests: remove `test_` from fixtures https://github.com/stac-utils/pystac/issues/948#issuecomment-1433176507 --- tests/conftest.py | 6 +++--- tests/test_catalog.py | 4 ++-- tests/test_collection.py | 4 ++-- tests/test_item.py | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index d38bb96b5..b4563f17f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -8,15 +8,15 @@ @pytest.fixture -def test_catalog() -> Catalog: +def catalog() -> Catalog: return Catalog("test-catalog", "A test catalog") @pytest.fixture -def test_collection() -> Catalog: +def collection() -> Catalog: return Collection("test-collection", "A test collection", ARBITRARY_EXTENT) @pytest.fixture -def test_item() -> Item: +def item() -> Item: return Item("test-item", ARBITRARY_GEOM, ARBITRARY_BBOX, datetime.now(), {}) diff --git a/tests/test_catalog.py b/tests/test_catalog.py index d88950cd3..e15bbb33c 100644 --- a/tests/test_catalog.py +++ b/tests/test_catalog.py @@ -1444,7 +1444,7 @@ def test_clone(self) -> None: self.assertIsInstance(cloned_catalog, self.BasicCustomCatalog) -def test_custom_catalog_from_dict(test_catalog: Catalog) -> None: +def test_custom_catalog_from_dict(catalog: Catalog) -> None: # https://github.com/stac-utils/pystac/issues/862 class CustomCatalog(Catalog): @classmethod @@ -1458,4 +1458,4 @@ def from_dict( ) -> CustomCatalog: return super().from_dict(d) - _ = CustomCatalog.from_dict(test_catalog.to_dict()) + _ = CustomCatalog.from_dict(catalog.to_dict()) diff --git a/tests/test_collection.py b/tests/test_collection.py index f92c502f2..6e903896d 100644 --- a/tests/test_collection.py +++ b/tests/test_collection.py @@ -514,7 +514,7 @@ def test_clone(self) -> None: self.assertIsInstance(cloned_collection, self.BasicCustomCollection) -def test_custom_collection_from_dict(test_collection: Collection) -> None: +def test_custom_collection_from_dict(collection: Collection) -> None: # https://github.com/stac-utils/pystac/issues/862 class CustomCollection(Collection): @classmethod @@ -528,4 +528,4 @@ def from_dict( ) -> CustomCollection: return super().from_dict(d) - _ = CustomCollection.from_dict(test_collection.to_dict()) + _ = CustomCollection.from_dict(collection.to_dict()) diff --git a/tests/test_item.py b/tests/test_item.py index 3568f5612..752334fb7 100644 --- a/tests/test_item.py +++ b/tests/test_item.py @@ -422,7 +422,7 @@ def test_clone(self) -> None: self.assertIsInstance(cloned_asset, self.CustomAsset) -def test_custom_item_from_dict(test_item: Item) -> None: +def test_custom_item_from_dict(item: Item) -> None: # https://github.com/stac-utils/pystac/issues/862 class CustomItem(Item): @classmethod @@ -436,7 +436,7 @@ def from_dict( ) -> CustomItem: return super().from_dict(d) - _ = CustomItem.from_dict(test_item.to_dict()) + _ = CustomItem.from_dict(item.to_dict()) def test_item_from_dict_raises_useful_error() -> None: