summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2023-10-18 14:34:18 +0200
committerAlexandre Flament <alex@al-f.net>2023-10-22 10:35:02 +0200
commitef56e1d68447742e0035ef8d75634c51e955a59c (patch)
treeed858dc06efc914a3532e1fec545a817d70b2971 /tests
parent01b5b9cb8ecc5db2a56e111fd306c1bb1a407709 (diff)
[fix] HTMLParser: undocumented not implemented method
In python versions <py3.10 there is an issue with an undocumented method HTMLParser.error() [1][2] that was deprecated in Python 3.4 and removed in Python 3.5. To be compatible to higher versions (>=py3.10) an error method is implemented which throws an AssertionError exception like the higher Python versions do [3]. [1] https://github.com/python/cpython/issues/76025 [2] https://bugs.python.org/issue31844 [3] https://github.com/python/cpython/pull/8562 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/test_utils.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/unit/test_utils.py b/tests/unit/test_utils.py
index 2ad4593a..6398e63f 100644
--- a/tests/unit/test_utils.py
+++ b/tests/unit/test_utils.py
@@ -41,6 +41,7 @@ class TestUtils(SearxTestCase):
self.assertIsInstance(utils.html_to_text(html_str), str)
self.assertIsNotNone(utils.html_to_text(html_str))
self.assertEqual(utils.html_to_text(html_str), "Test text")
+ self.assertEqual(utils.html_to_text(r"regexp: (?<![a-zA-Z]"), "regexp: (?<![a-zA-Z]")
def test_extract_text(self):
html_str = """