Skip to content

gh-111800: Fix test_recursive_repr from test_io under WASI #112150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions Lib/test/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -1234,11 +1234,9 @@ def test_recursive_repr(self):
# Issue #25455
raw = self.MockRawIO()
b = self.tp(raw)
with support.swap_attr(raw, 'name', b):
try:
with support.swap_attr(raw, 'name', b), support.infinite_recursion(25):
with self.assertRaises(RuntimeError):
repr(b) # Should not crash
except RuntimeError:
pass

def test_flush_error_on_close(self):
# Test that buffered file is closed despite failed flush
Expand Down Expand Up @@ -2801,11 +2799,9 @@ def test_recursive_repr(self):
# Issue #25455
raw = self.BytesIO()
t = self.TextIOWrapper(raw, encoding="utf-8")
with support.swap_attr(raw, 'name', t):
try:
with support.swap_attr(raw, 'name', t), support.infinite_recursion(25):
with self.assertRaises(RuntimeError):
repr(t) # Should not crash
except RuntimeError:
pass

def test_line_buffering(self):
r = self.BytesIO()
Expand Down