mirror of
https://github.com/python/cpython.git
synced 2025-07-08 03:45:36 +00:00
#23144: merge with 3.4.
This commit is contained in:
commit
20a2c6482e
3 changed files with 26 additions and 5 deletions
|
@ -72,9 +72,6 @@ class EventCollectorExtra(EventCollector):
|
|||
|
||||
class EventCollectorCharrefs(EventCollector):
|
||||
|
||||
def get_events(self):
|
||||
return self.events
|
||||
|
||||
def handle_charref(self, data):
|
||||
self.fail('This should never be called with convert_charrefs=True')
|
||||
|
||||
|
@ -633,6 +630,18 @@ text
|
|||
]
|
||||
self._run_check(html, expected)
|
||||
|
||||
def test_convert_charrefs_dropped_text(self):
|
||||
# #23144: make sure that all the events are triggered when
|
||||
# convert_charrefs is True, even if we don't call .close()
|
||||
parser = EventCollector(convert_charrefs=True)
|
||||
# before the fix, bar & baz was missing
|
||||
parser.feed("foo <a>link</a> bar & baz")
|
||||
self.assertEqual(
|
||||
parser.get_events(),
|
||||
[('data', 'foo '), ('starttag', 'a', []), ('data', 'link'),
|
||||
('endtag', 'a'), ('data', ' bar & baz')]
|
||||
)
|
||||
|
||||
|
||||
class AttributesTestCase(TestCaseBase):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue