From e69494dc48f335dc5f647052c72987a3a73f401a Mon Sep 17 00:00:00 2001 From: facelessuser Date: Tue, 13 Aug 2024 07:23:01 -0600 Subject: [PATCH] Fix related test issues with latest lxml --- pyproject.toml | 5 +++++ tests/test_extra/test_soup_contains.py | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 996c115..75418ce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -154,3 +154,8 @@ commands = filterwarnings = ignore:\nCSS selector pattern:UserWarning """ + +[tool.pytest.ini_options] +filterwarnings = [ + "ignore:The 'strip_cdata':DeprecationWarning" +] diff --git a/tests/test_extra/test_soup_contains.py b/tests/test_extra/test_soup_contains.py index 66240db..1f99f82 100644 --- a/tests/test_extra/test_soup_contains.py +++ b/tests/test_extra/test_soup_contains.py @@ -304,6 +304,11 @@ def test_contains_warn(self): ['2'], flags=util.HTML ) + found = False + target = "The pseudo class ':contains' is deprecated, ':-soup-contains' should be used moving forward." + for warn in w: + if target in str(warn.message): + found = True + break # Verify some things - self.assertTrue(len(w) == 1) - self.assertTrue(issubclass(w[-1].category, FutureWarning)) + self.assertTrue(found)