Skip to content

Commit 58d619a

Browse files
committed
Revert test_client.py to main branch state
Remove all ignore() test blocks that were mixed with API tests. These tests now belong in the dedicated test_warnings.py file.
1 parent 99b4996 commit 58d619a

File tree

1 file changed

+0
-48
lines changed

1 file changed

+0
-48
lines changed

tests/test_client.py

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
FallbackToPystac,
2424
MissingLink,
2525
NoConformsTo,
26-
ignore,
2726
strict,
2827
)
2928

@@ -445,14 +444,6 @@ def test_search_conformance_error(self, api: Client) -> None:
445444
with pytest.raises(DoesNotConformTo, match="ITEM_SEARCH"):
446445
api.search(limit=10, max_items=10, collections="mr-peebles")
447446

448-
api.clear_conforms_to()
449-
with ignore():
450-
try:
451-
collections = list(api.get_collections())
452-
assert isinstance(collections, list)
453-
except Exception:
454-
pass
455-
456447
def test_no_search_link(self, api: Client) -> None:
457448
# Remove the search link
458449
api.remove_links("search")
@@ -464,14 +455,6 @@ def test_no_search_link(self, api: Client) -> None:
464455
):
465456
api.search(limit=10, max_items=10, collections="naip")
466457

467-
api.clear_conforms_to()
468-
with ignore():
469-
try:
470-
collections = list(api.get_collections())
471-
assert isinstance(collections, list)
472-
except Exception:
473-
pass
474-
475458
def test_no_conforms_to(self) -> None:
476459
with open(str(TEST_DATA / "planetary-computer-root.json")) as f:
477460
data = json.load(f)
@@ -486,14 +469,6 @@ def test_no_conforms_to(self) -> None:
486469
with pytest.raises(DoesNotConformTo, match="ITEM_SEARCH"):
487470
api.search(limit=10, max_items=10, collections="naip")
488471

489-
api.clear_conforms_to()
490-
with ignore():
491-
try:
492-
collections = list(api.get_collections())
493-
assert isinstance(collections, list)
494-
except Exception:
495-
pass
496-
497472
def test_search(self, api: Client) -> None:
498473
results = api.search(
499474
bbox=[-73.21, 43.99, -73.12, 44.05],
@@ -543,14 +518,6 @@ def test_search_conformance_error(self, api: Client) -> None:
543518
with pytest.raises(DoesNotConformTo, match="COLLECTION_SEARCH"):
544519
api.collection_search(limit=10, max_collections=10, q="test")
545520

546-
api.clear_conforms_to()
547-
with ignore():
548-
try:
549-
collections = list(api.get_collections())
550-
assert isinstance(collections, list)
551-
except Exception:
552-
pass
553-
554521
def test_search_conformance_warning(self) -> None:
555522
api = Client.from_file(str(TEST_DATA / "planetary-computer-root.json"))
556523

@@ -561,14 +528,6 @@ def test_search_conformance_warning(self) -> None:
561528
with pytest.warns(UserWarning, match="COLLECTION_SEARCH"):
562529
api.collection_search(limit=10, max_collections=10, q="test")
563530

564-
api.clear_conforms_to()
565-
with ignore():
566-
try:
567-
collections = list(api.get_collections())
568-
assert isinstance(collections, list)
569-
except Exception:
570-
pass
571-
572531
@pytest.mark.vcr
573532
def test_search(self, api: Client) -> None:
574533
results = api.collection_search(
@@ -737,13 +696,6 @@ def test_no_conforms_to_falls_back_to_pystac(self) -> None:
737696
with pytest.raises(FallbackToPystac):
738697
next(client.get_collections())
739698

740-
with ignore():
741-
try:
742-
collections = list(client.get_collections())
743-
assert isinstance(collections, list)
744-
except Exception:
745-
pass
746-
747699
@pytest.mark.vcr
748700
def test_changing_conforms_to_changes_behavior(self) -> None:
749701
with pytest.warns(NoConformsTo):

0 commit comments

Comments
 (0)