diff options
author | Leonard Richardson <leonardr@segfault.org> | 2019-07-15 14:15:14 -0400 |
---|---|---|
committer | Leonard Richardson <leonardr@segfault.org> | 2019-07-15 14:15:14 -0400 |
commit | 81e86c866490ba9a5ce7109023b657d09d39dae1 (patch) | |
tree | ac975a82d24afb3e1ec9fe681aac80373f4bf919 | |
parent | 0df054db08ef3286482694ee0c9aa85b5313dfd2 (diff) |
Improved comments in tests.
-rw-r--r-- | bs4/tests/test_tree.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/bs4/tests/test_tree.py b/bs4/tests/test_tree.py index ffbc29e..c1cd581 100644 --- a/bs4/tests/test_tree.py +++ b/bs4/tests/test_tree.py @@ -25,7 +25,7 @@ from bs4.element import ( Comment, Declaration, Doctype, - HTMLFormatter, + Formatter, NavigableString, SoupStrainer, Tag, @@ -1687,7 +1687,9 @@ class TestEncoding(SoupTest): class TestFormatter(SoupTest): def test_sort_attributes(self): - class UnsortedFormatter(HTMLFormatter): + # Test the ability to override Formatter.attributes() to, + # e.g., disable the normal sorting of attributes. + class UnsortedFormatter(Formatter): def attributes(self, tag): self.called_with = tag for k, v in sorted(tag.attrs.items()): @@ -1699,7 +1701,7 @@ class TestFormatter(SoupTest): formatter = UnsortedFormatter() decoded = soup.decode(formatter=formatter) - # sort_attributes() was called on the <p> tag. It filtered out one + # 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) |