summaryrefslogtreecommitdiff
path: root/bs4/tests/test_formatter.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonardr@segfault.org>2021-09-07 20:09:32 -0400
committerLeonard Richardson <leonardr@segfault.org>2021-09-07 20:09:32 -0400
commit9d68e443978afda17f59f0ff9e73af2b9b0921c2 (patch)
treec23b00ad1379e3c10212c048ef84fc40c9321da3 /bs4/tests/test_formatter.py
parent70f546b1e689a70e2f103795efce6d261a3dadf7 (diff)
Goodbye, Python 2. [bug=1942919]
Diffstat (limited to 'bs4/tests/test_formatter.py')
-rw-r--r--bs4/tests/test_formatter.py20
1 files changed, 10 insertions, 10 deletions
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 <p> tag. It filtered out one
# attribute and sorted the other two.
- self.assertEquals(formatter.called_with, soup.p)
- self.assertEquals(u'<p aval="2" cval="1"></p>', decoded)
+ self.assertEqual(formatter.called_with, soup.p)
+ self.assertEqual('<p aval="2" cval="1"></p>', 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'<option selected=""></option>',
soup.option.encode(formatter='html')
)
- self.assertEquals(
+ self.assertEqual(
b'<option selected></option>',
soup.option.encode(formatter='html5')
)