mirror of
https://github.com/python/cpython
synced 2024-10-14 09:43:55 +00:00
gh-111800: Fix test_recursive_repr
from test_io
under WASI to not recurse so deeply (GH-112150)
This commit is contained in:
parent
762eb58220
commit
974847be44
|
@ -1234,11 +1234,9 @@ def test_recursive_repr(self):
|
||||||
# Issue #25455
|
# Issue #25455
|
||||||
raw = self.MockRawIO()
|
raw = self.MockRawIO()
|
||||||
b = self.tp(raw)
|
b = self.tp(raw)
|
||||||
with support.swap_attr(raw, 'name', b):
|
with support.swap_attr(raw, 'name', b), support.infinite_recursion(25):
|
||||||
try:
|
with self.assertRaises(RuntimeError):
|
||||||
repr(b) # Should not crash
|
repr(b) # Should not crash
|
||||||
except RuntimeError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
def test_flush_error_on_close(self):
|
def test_flush_error_on_close(self):
|
||||||
# Test that buffered file is closed despite failed flush
|
# Test that buffered file is closed despite failed flush
|
||||||
|
@ -2801,11 +2799,9 @@ def test_recursive_repr(self):
|
||||||
# Issue #25455
|
# Issue #25455
|
||||||
raw = self.BytesIO()
|
raw = self.BytesIO()
|
||||||
t = self.TextIOWrapper(raw, encoding="utf-8")
|
t = self.TextIOWrapper(raw, encoding="utf-8")
|
||||||
with support.swap_attr(raw, 'name', t):
|
with support.swap_attr(raw, 'name', t), support.infinite_recursion(25):
|
||||||
try:
|
with self.assertRaises(RuntimeError):
|
||||||
repr(t) # Should not crash
|
repr(t) # Should not crash
|
||||||
except RuntimeError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
def test_line_buffering(self):
|
def test_line_buffering(self):
|
||||||
r = self.BytesIO()
|
r = self.BytesIO()
|
||||||
|
|
Loading…
Reference in a new issue