Skip to content

Commit c3837af

Browse files
Simplify test
1 parent adb61a2 commit c3837af

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Lib/test/test_pyexpat.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -705,16 +705,16 @@ def test_trigger_leak(self):
705705
@support.skip_emscripten_stack_overflow()
706706
@support.skip_wasi_stack_overflow()
707707
def test_deeply_nested_content_model(self):
708-
data = ('<!DOCTYPE root [\n<!ELEMENT root '
709-
+ '(a, ' * 500000 + 'a'
710-
+ ')' * 500000
711-
+ '>\n]>\n<root/>\n').encode('UTF-8')
708+
data = (b'<!DOCTYPE root [\n<!ELEMENT root '
709+
+ b'(a, ' * 500000 + b'a'
710+
+ b')' * 500000
711+
+ b'>\n]>\n<root/>\n')
712712

713713
parser = expat.ParserCreate()
714714
parser.ElementDeclHandler = lambda _1, _2: None
715-
with self.assertRaises(RecursionError):
716-
with support.infinite_recursion():
717-
parser.ParseFile(BytesIO(data))
715+
with support.infinite_recursion():
716+
with self.assertRaises(RecursionError):
717+
parser.Parse(data)
718718

719719
class MalformedInputTest(unittest.TestCase):
720720
def test1(self):

0 commit comments

Comments
 (0)