Skip to content

Commit e69494d

Browse files
committed
Fix related test issues with latest lxml
1 parent 281f5a6 commit e69494d

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

pyproject.toml

+5
Original file line numberDiff line numberDiff line change
@@ -154,3 +154,8 @@ commands =
154154
filterwarnings =
155155
ignore:\nCSS selector pattern:UserWarning
156156
"""
157+
158+
[tool.pytest.ini_options]
159+
filterwarnings = [
160+
"ignore:The 'strip_cdata':DeprecationWarning"
161+
]

tests/test_extra/test_soup_contains.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,11 @@ def test_contains_warn(self):
304304
['2'],
305305
flags=util.HTML
306306
)
307+
found = False
308+
target = "The pseudo class ':contains' is deprecated, ':-soup-contains' should be used moving forward."
309+
for warn in w:
310+
if target in str(warn.message):
311+
found = True
312+
break
307313
# Verify some things
308-
self.assertTrue(len(w) == 1)
309-
self.assertTrue(issubclass(w[-1].category, FutureWarning))
314+
self.assertTrue(found)

0 commit comments

Comments
 (0)