Add unit test for should_ignore_error to ensure repeated calls each trigger a DeprecationWarning

This commit is contained in:
Akarsh Singhal 2025-11-28 23:36:18 -05:00
parent c12a967097
commit 37de8242a9

View file

@ -20,3 +20,10 @@ def test_should_ignore_error_returns_false():
with pytest.warns(DeprecationWarning):
result = app.should_ignore_error(Exception())
assert result is False
def test_should_ignore_error_warning_repeated_calls():
"""Verify repeated calls each trigger a DeprecationWarning."""
app = Flask(__name__)
for _ in range(3):
with pytest.warns(DeprecationWarning):
assert app.should_ignore_error(Exception()) is False