flask/tests
Ayush Patil 04a5a04140 Deprecate should_ignore_error method
The `should_ignore_error()` method was added in f191809 to support
context preservation for debugging, but it no longer serves its
original purpose and adds unnecessary overhead.

Issues with the current implementation:
- Always returns False by default
- Called on every single request with no benefit
- The original intention for error ignoring during debugging is not
  how context preservation works anymore
- No documentation beyond API reference
- No tests for the functionality
- No evidence of real-world usage

Changes:
- Add deprecation warning to App.should_ignore_error() that will be
  removed in Flask 4.0
- Optimize call site to only invoke the method if it's been overridden
  by a subclass, eliminating the function call overhead for 99.9% of
  requests
- Add comprehensive tests for the deprecation behavior
- Update CHANGES.rst with deprecation notice

Teardown handlers should manage their own error handling instead of
relying on this method.

Fixes #5816
2025-12-18 17:47:38 +05:30
..
static add text parameter to config.from_file 2023-02-23 11:10:21 -08:00
templates add pre-commit config for flake8 2019-06-01 09:13:46 -04:00
test_apps use ruff linter and formatter 2023-11-15 12:14:37 -08:00
type_check enable secret key rotation 2024-11-08 08:09:01 -08:00
conftest.py merge app and request context 2025-09-19 16:43:53 -07:00
test_appctx.py merge app and request context 2025-09-19 16:43:53 -07:00
test_async.py remove previously deprecated code 2023-02-23 08:35:16 -08:00
test_basic.py secret key rotation: fix key list ordering 2025-05-12 18:30:27 -07:00
test_blueprints.py use template_filter without parens 2025-08-19 12:33:21 -07:00
test_cli.py drop end of life python versions 2025-05-13 08:31:54 -07:00
test_config.py use tmp_path instead of tmpdir 2023-05-02 10:38:27 -07:00
test_converters.py converters have access to session 2021-05-14 08:11:09 -07:00
test_deprecations.py Deprecate should_ignore_error method 2025-12-18 17:47:38 +05:30
test_helpers.py refactor stream_with_context for async views 2025-08-19 08:18:55 -07:00
test_instance_config.py remove tests about deprecated pkgutil.get_loader 2025-03-29 15:42:58 -07:00
test_json.py update project files (#5457) 2024-04-07 10:24:40 -07:00
test_json_tag.py deprecate markupsafe exports 2023-02-23 08:55:01 -08:00
test_logging.py remove unused module docstrings 2020-04-04 12:28:08 -07:00
test_regression.py update tests for relative redirects 2022-03-25 11:48:26 -07:00
test_reqctx.py pass context through dispatch methods 2025-09-19 17:33:30 -07:00
test_request.py configure and check trusted_hosts 2024-11-12 21:01:55 -08:00
test_session_interface.py merge app and request context 2025-09-19 16:43:53 -07:00
test_signals.py use ruff linter and formatter 2023-11-15 12:14:37 -08:00
test_subclassing.py pass context through dispatch methods 2025-09-19 17:33:30 -07:00
test_templating.py use template_filter without parens 2025-08-19 12:33:21 -07:00
test_testing.py merge app and request context 2025-09-19 16:43:53 -07:00
test_user_error_handler.py refactor error checks in register_error_handler 2022-05-03 11:52:11 -06:00
test_views.py use ruff linter and formatter 2023-11-15 12:14:37 -08:00