Skip to content

Commit

Permalink
Fix related test issues with latest lxml
Browse files Browse the repository at this point in the history
  • Loading branch information
facelessuser committed Aug 13, 2024
1 parent 281f5a6 commit e69494d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,8 @@ commands =
filterwarnings =
ignore:\nCSS selector pattern:UserWarning
"""

[tool.pytest.ini_options]
filterwarnings = [
"ignore:The 'strip_cdata':DeprecationWarning"
]
9 changes: 7 additions & 2 deletions tests/test_extra/test_soup_contains.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit e69494d

Please sign in to comment.