Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Added

- Add comprehensive test coverage for warning context managers (`ignore()` and `strict()`) ([#832](https://github.com/stac-utils/pystac-client/pull/832))
- Moved -Werror to pyproject.toml ([#841](https://github.com/stac-utils/pystac-client/pull/841))

### Changed

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ select = ["E", "F", "W", "I"]

[tool.pytest.ini_options]
markers = "vcr: records network activity"
addopts = "--benchmark-skip --block-network"
addopts = "--benchmark-skip --block-network -Werror"
filterwarnings = [
"ignore::ResourceWarning",
"ignore::pytest.PytestUnraisableExceptionWarning",
Expand Down
2 changes: 1 addition & 1 deletion scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
./scripts/lint
./scripts/format
# Test suite with coverage enabled
pytest -Werror --cov pystac_client --cov-report term-missing
pytest --cov pystac_client --cov-report term-missing
coverage xml
fi
fi
2 changes: 0 additions & 2 deletions tests/test_warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class TestWarningContextManagers:
@pytest.mark.filterwarnings("error")
def test_ignore_context_manager(self) -> None:
"""Test that ignore() context manager suppresses warnings."""
api = Client.from_file(str(TEST_DATA / "planetary-computer-root.json"))
Expand All @@ -16,7 +15,6 @@ def test_ignore_context_manager(self) -> None:
with ignore():
api.collection_search(limit=10, max_collections=10, q="test")

@pytest.mark.filterwarnings("error")
def test_strict_context_manager(self) -> None:
"""Test that strict() context manager converts warnings to exceptions."""
api = Client.from_file(str(TEST_DATA / "planetary-computer-root.json"))
Expand Down