diff options
author | Leonard Richardson <leonardr@segfault.org> | 2023-01-27 20:06:49 -0500 |
---|---|---|
committer | Leonard Richardson <leonardr@segfault.org> | 2023-01-27 20:06:49 -0500 |
commit | 5d4b8486b096aae9605d29774038107f01ecad65 (patch) | |
tree | a1e0ad353f9817689db347a48cd0c250a44a06d9 /bs4/tests/test_lxml.py | |
parent | 770030fccfd374e5d12f257e9be30b23ddc844a5 (diff) |
Check the associated filename for more warnings.
Diffstat (limited to 'bs4/tests/test_lxml.py')
-rw-r--r-- | bs4/tests/test_lxml.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bs4/tests/test_lxml.py b/bs4/tests/test_lxml.py index 396ca0e..e88515c 100644 --- a/bs4/tests/test_lxml.py +++ b/bs4/tests/test_lxml.py @@ -68,7 +68,9 @@ class TestLXMLTreeBuilder(SoupTest, HTMLTreeBuilderSmokeTest): with warnings.catch_warnings(record=True) as w: soup = BeautifulStoneSoup("<b />") assert "<b/>" == str(soup.b) - assert "BeautifulStoneSoup class is deprecated" in str(w[0].message) + [warning] = w + assert warning.filename == __file__ + assert "BeautifulStoneSoup class is deprecated" in str(warning.message) def test_tracking_line_numbers(self): # The lxml TreeBuilder cannot keep track of line numbers from |