Skip to content

Commit 86c1fe4

Browse files
committed
gh-95813: Add unittest
1 parent 774ab32 commit 86c1fe4

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Lib/test/test_htmlparser.py

+14
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import pprint
55
import unittest
66

7+
from unittest.mock import patch
8+
79

810
class EventCollector(html.parser.HTMLParser):
911

@@ -787,5 +789,17 @@ def test_weird_chars_in_unquoted_attribute_values(self):
787789
('starttag', 'form',
788790
[('action', 'bogus|&#()value')])])
789791

792+
793+
class TestInheritance(unittest.TestCase):
794+
795+
@patch("_markupbase.ParserBase.__init__")
796+
@patch("_markupbase.ParserBase.reset")
797+
def test_init(self, super_init_method, super_reset_method):
798+
with patch('_markupbase.ParserBase') as parser_base:
799+
a = html.parser.HTMLParser()
800+
self.assertTrue(super_init_method.called)
801+
self.assertTrue(super_reset_method.called)
802+
803+
790804
if __name__ == "__main__":
791805
unittest.main()

0 commit comments

Comments
 (0)