Skip to content

Commit c498bd4

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 c498bd4

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

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)