From 24fca77a9e156ec77f1bec115199c9be176edcc2 Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Sat, 5 Oct 2019 16:24:19 -0400 Subject: Avoid a crash when unpickling certain parse trees generated using html5lib on Python 3. [bug=1843545] --- bs4/tests/test_soup.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'bs4/tests/test_soup.py') diff --git a/bs4/tests/test_soup.py b/bs4/tests/test_soup.py index 3603e81..dc88662 100644 --- a/bs4/tests/test_soup.py +++ b/bs4/tests/test_soup.py @@ -638,10 +638,13 @@ class TestUnicodeDammit(unittest.TestCase): class TestNamedspacedAttribute(SoupTest): - def test_name_may_be_none(self): + def test_name_may_be_none_or_missing(self): a = NamespacedAttribute("xmlns", None) self.assertEqual(a, "xmlns") + a = NamespacedAttribute("xmlns") + self.assertEqual(a, "xmlns") + def test_attribute_is_equivalent_to_colon_separated_string(self): a = NamespacedAttribute("a", "b") self.assertEqual("a:b", a) -- cgit v1.2.3