diff options
Diffstat (limited to 'bs4/tests/test_tree.py')
-rw-r--r-- | bs4/tests/test_tree.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/bs4/tests/test_tree.py b/bs4/tests/test_tree.py index e456966..0c49cb4 100644 --- a/bs4/tests/test_tree.py +++ b/bs4/tests/test_tree.py @@ -1282,13 +1282,17 @@ class TestDeprecatedArguments(SoupTest): [result] = soup.find_all(text='markup') assert result == 'markup' assert result.parent.name == 'b' - msg = str(w[0].message) + [warning] = w + assert warning.filename == __file__ + msg = str(warning.message) assert msg == "The 'text' argument to find()-type methods is deprecated. Use 'string' instead." def test_soupstrainer_constructor_string(self): with warnings.catch_warnings(record=True) as w: strainer = SoupStrainer(text="text") assert strainer.text == 'text' - msg = str(w[0].message) + [warning] = w + msg = str(warning.message) + assert warning.filename == __file__ assert msg == "The 'text' argument to the SoupStrainer constructor is deprecated. Use 'string' instead." |