Skip to content

Commit 19ccb0c

Browse files
committed
Moves -Werror from scripts/test to pyproject.toml for consistent warning handling across all test runs. Removes redundant decorators.
1 parent 7b76c08 commit 19ccb0c

File tree

4 files changed

+3
-4
lines changed

4 files changed

+3
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1010
### Added
1111

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

1415
### Changed
1516

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ select = ["E", "F", "W", "I"]
109109

110110
[tool.pytest.ini_options]
111111
markers = "vcr: records network activity"
112-
addopts = "--benchmark-skip --block-network"
112+
addopts = "--benchmark-skip --block-network -Werror"
113113
filterwarnings = [
114114
"ignore::ResourceWarning",
115115
"ignore::pytest.PytestUnraisableExceptionWarning",

scripts/test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
2020
./scripts/lint
2121
./scripts/format
2222
# Test suite with coverage enabled
23-
pytest -Werror --cov pystac_client --cov-report term-missing
23+
pytest --cov pystac_client --cov-report term-missing
2424
coverage xml
2525
fi
2626
fi

tests/test_warnings.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88

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

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

0 commit comments

Comments
 (0)