Skip to content

Commit

Permalink
refactor, tests: remove test_ from fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
gadomski committed Feb 22, 2023
1 parent a573835 commit f7b7b9d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(), {})
4 changes: 2 additions & 2 deletions tests/test_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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())
4 changes: 2 additions & 2 deletions tests/test_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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())
4 changes: 2 additions & 2 deletions tests/test_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit f7b7b9d

Please sign in to comment.