Skip to content

Update test_fileio.py from Cpython v3.11.2 #4821

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 1 commit into from
Apr 3, 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
7 changes: 5 additions & 2 deletions Lib/test/test_fileio.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
from weakref import proxy
from functools import wraps

from test.support import cpython_only, swap_attr, gc_collect
from test.support import (
cpython_only, swap_attr, gc_collect, is_emscripten, is_wasi
)
from test.support.os_helper import (TESTFN, TESTFN_UNICODE, make_bad_fd)
from test.support.warnings_helper import check_warnings
from collections import UserList
Expand Down Expand Up @@ -65,6 +67,7 @@ def testAttributes(self):
self.assertRaises((AttributeError, TypeError),
setattr, f, attr, 'oops')

@unittest.skipIf(is_wasi, "WASI does not expose st_blksize.")
def testBlksize(self):
# test private _blksize attribute
blksize = io.DEFAULT_BUFFER_SIZE
Expand Down Expand Up @@ -415,7 +418,7 @@ def testAbles(self):
self.assertEqual(f.isatty(), False)
f.close()

if sys.platform != "win32":
if sys.platform != "win32" and not is_emscripten:
try:
f = self.FileIO("/dev/tty", "a")
except OSError:
Expand Down