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)