From 71e6e49af92cc395c1896b845042fced8f6ed6a7 Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Mon, 30 Jul 2018 20:19:51 -0400 Subject: Fix an exception when a custom formatter was asked to format a void element. [bug=1784408] --- bs4/tests/test_tree.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bs4/tests/test_tree.py') diff --git a/bs4/tests/test_tree.py b/bs4/tests/test_tree.py index 68887b4..883cd8a 100644 --- a/bs4/tests/test_tree.py +++ b/bs4/tests/test_tree.py @@ -1474,14 +1474,14 @@ class TestSubstitutions(SoupTest): self.document_for(u"<>")) def test_formatter_custom(self): - markup = u"<foo>bar" + markup = u"<foo>bar
" soup = self.soup(markup) decoded = soup.decode(formatter = lambda x: x.upper()) # Instead of normal entity conversion code, the custom # callable is called on every string. self.assertEqual( decoded, - self.document_for(u"BAR")) + self.document_for(u"BAR
")) def test_formatter_is_run_on_attribute_values(self): markup = u'e' -- cgit v1.2.3