Add parameterized unit test for should_ignore_error covering multiple exception types to verify DeprecationWarning
This commit is contained in:
parent
122e6f1052
commit
0b86f57e4b
1 changed files with 9 additions and 1 deletions
|
|
@ -2,6 +2,14 @@ import pytest
|
|||
from flask import Flask
|
||||
|
||||
def test_should_ignore_error_deprecation_warning():
|
||||
"""Minimal test: check DeprecationWarning and return value."""
|
||||
app = Flask(__name__)
|
||||
with pytest.warns(DeprecationWarning):
|
||||
assert app.should_ignore_error(None) is False
|
||||
assert app.should_ignore_error(None) is False
|
||||
|
||||
@pytest.mark.parametrize("error", [Exception(), ValueError(), RuntimeError()])
|
||||
def test_should_ignore_error_multiple_exceptions(error):
|
||||
"""Verify that should_ignore_error issues a DeprecationWarning for multiple exception types."""
|
||||
app = Flask(__name__)
|
||||
with pytest.warns(DeprecationWarning):
|
||||
assert app.should_ignore_error(error) is False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue