diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2025-10-22 10:04:38 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-22 10:04:38 +0200 |
| commit | 185b049e9e72a5ff4b07e33605e10eb4f52ca74c (patch) | |
| tree | c94f93b75a36fd5132b7964c88bb5a0f85c7e0c9 /tests/utils_tests | |
| parent | b6c9246d0a3ef5f9a40b15cc289b495351eae109 (diff) | |
Refs #36499 -- Made TestUtilsHtml.test_strip_tags() assume behavior change in X.Y.0 version for Python 3.14+.
This also removes unsupported versions of Python from the test dict.
Diffstat (limited to 'tests/utils_tests')
| -rw-r--r-- | tests/utils_tests/test_html.py | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/tests/utils_tests/test_html.py b/tests/utils_tests/test_html.py index 7167383aef..bf00d14496 100644 --- a/tests/utils_tests/test_html.py +++ b/tests/utils_tests/test_html.py @@ -116,21 +116,20 @@ class TestUtilsHtml(SimpleTestCase): self.check_output(linebreaks, lazystr(value), output) def test_strip_tags(self): - # Python fixed a quadratic-time issue in HTMLParser in 3.13.6, 3.12.12, - # 3.11.14, 3.10.19, and 3.9.24. The fix slightly changes HTMLParser's - # output, so tests for particularly malformed input must handle both - # old and new results. The check below is temporary until all supported - # Python versions and CI workers include the fix. See: + # Python fixed a quadratic-time issue in HTMLParser in 3.13.6, 3.12.12. + # The fix slightly changes HTMLParser's output, so tests for + # particularly malformed input must handle both old and new results. + # The check below is temporary until all supported Python versions and + # CI workers include the fix. See: # https://github.com/python/cpython/commit/6eb6c5db min_fixed = { - (3, 14): (3, 14), (3, 13): (3, 13, 6), (3, 12): (3, 12, 12), - (3, 11): (3, 11, 14), - (3, 10): (3, 10, 19), - (3, 9): (3, 9, 24), } - htmlparser_fixed = sys.version_info >= min_fixed[sys.version_info[:2]] + major_version = sys.version_info[:2] + htmlparser_fixed = sys.version_info >= min_fixed.get( + major_version, major_version + ) items = ( ( "<p>See: 'é is an apostrophe followed by e acute</p>", |
