From 9d68e443978afda17f59f0ff9e73af2b9b0921c2 Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Tue, 7 Sep 2021 20:09:32 -0400 Subject: Goodbye, Python 2. [bug=1942919] --- bs4/tests/test_formatter.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'bs4/tests/test_formatter.py') diff --git a/bs4/tests/test_formatter.py b/bs4/tests/test_formatter.py index 718989b..c188e18 100644 --- a/bs4/tests/test_formatter.py +++ b/bs4/tests/test_formatter.py @@ -18,12 +18,12 @@ class TestFormatter(SoupTest): # Attributes come out sorted by name. In Python 3, attributes # normally come out of a dictionary in the order they were # added. - self.assertEquals([('a', 2), ('b', 1)], formatter.attributes(tag)) + self.assertEqual([('a', 2), ('b', 1)], formatter.attributes(tag)) # This works even if Tag.attrs is None, though this shouldn't # normally happen. tag.attrs = None - self.assertEquals([], formatter.attributes(tag)) + self.assertEqual([], formatter.attributes(tag)) def test_sort_attributes(self): # Test the ability to override Formatter.attributes() to, @@ -42,8 +42,8 @@ class TestFormatter(SoupTest): # attributes() was called on the

tag. It filtered out one # attribute and sorted the other two. - self.assertEquals(formatter.called_with, soup.p) - self.assertEquals(u'

', decoded) + self.assertEqual(formatter.called_with, soup.p) + self.assertEqual('

', decoded) def test_empty_attributes_are_booleans(self): # Test the behavior of empty_attributes_are_booleans as well @@ -51,17 +51,17 @@ class TestFormatter(SoupTest): for name in ('html', 'minimal', None): formatter = HTMLFormatter.REGISTRY[name] - self.assertEquals(False, formatter.empty_attributes_are_booleans) + self.assertEqual(False, formatter.empty_attributes_are_booleans) formatter = XMLFormatter.REGISTRY[None] - self.assertEquals(False, formatter.empty_attributes_are_booleans) + self.assertEqual(False, formatter.empty_attributes_are_booleans) formatter = HTMLFormatter.REGISTRY['html5'] - self.assertEquals(True, formatter.empty_attributes_are_booleans) + self.assertEqual(True, formatter.empty_attributes_are_booleans) # Verify that the constructor sets the value. formatter = Formatter(empty_attributes_are_booleans=True) - self.assertEquals(True, formatter.empty_attributes_are_booleans) + self.assertEqual(True, formatter.empty_attributes_are_booleans) # Now demonstrate what it does to markup. for markup in ( @@ -70,11 +70,11 @@ class TestFormatter(SoupTest): ): soup = self.soup(markup) for formatter in ('html', 'minimal', 'xml', None): - self.assertEquals( + self.assertEqual( b'', soup.option.encode(formatter='html') ) - self.assertEquals( + self.assertEqual( b'', soup.option.encode(formatter='html5') ) -- cgit v1.2.3