diff options
author | Leonard Richardson <leonardr@segfault.org> | 2023-03-21 11:27:08 -0400 |
---|---|---|
committer | Leonard Richardson <leonardr@segfault.org> | 2023-03-21 11:27:08 -0400 |
commit | 3be39f46ec502fe20d5a95ed3292d0dccd3b1aec (patch) | |
tree | 01a8f5556c32dadc4e47f639d0a4dac078adeab2 /bs4/tests/test_formatter.py | |
parent | d923a1cc966a4faa966f5d6f0a1fe09bd482949a (diff) |
Reimplemented the pretty-print algorithm to remove recursive function calls.
Diffstat (limited to 'bs4/tests/test_formatter.py')
-rw-r--r-- | bs4/tests/test_formatter.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/bs4/tests/test_formatter.py b/bs4/tests/test_formatter.py index 84d4e3b..528b16d 100644 --- a/bs4/tests/test_formatter.py +++ b/bs4/tests/test_formatter.py @@ -80,20 +80,20 @@ class TestFormatter(SoupTest): @pytest.mark.parametrize( "indent,expect", [ - (None, '<a>\n<b>\ntext\n</b>\n</a>'), - (-1, '<a>\n<b>\ntext\n</b>\n</a>'), - (0, '<a>\n<b>\ntext\n</b>\n</a>'), - ("", '<a>\n<b>\ntext\n</b>\n</a>'), + (None, '<a>\n<b>\ntext\n</b>\n</a>\n'), + (-1, '<a>\n<b>\ntext\n</b>\n</a>\n'), + (0, '<a>\n<b>\ntext\n</b>\n</a>\n'), + ("", '<a>\n<b>\ntext\n</b>\n</a>\n'), - (1, '<a>\n <b>\n text\n </b>\n</a>'), - (2, '<a>\n <b>\n text\n </b>\n</a>'), + (1, '<a>\n <b>\n text\n </b>\n</a>\n'), + (2, '<a>\n <b>\n text\n </b>\n</a>\n'), - ("\t", '<a>\n\t<b>\n\t\ttext\n\t</b>\n</a>'), - ('abc', '<a>\nabc<b>\nabcabctext\nabc</b>\n</a>'), + ("\t", '<a>\n\t<b>\n\t\ttext\n\t</b>\n</a>\n'), + ('abc', '<a>\nabc<b>\nabcabctext\nabc</b>\n</a>\n'), # Some invalid inputs -- the default behavior is used. - (object(), '<a>\n <b>\n text\n </b>\n</a>'), - (b'bytes', '<a>\n <b>\n text\n </b>\n</a>'), + (object(), '<a>\n <b>\n text\n </b>\n</a>\n'), + (b'bytes', '<a>\n <b>\n text\n </b>\n</a>\n'), ] ) def test_indent(self, indent, expect): |