Skip to content

Commit aeba695

Browse files
authored
Merge pull request RustPython#4821 from Masorubka1/test_fileio
Update test_fileio.py from Cpython v3.11.2
2 parents 3928217 + 8bc32eb commit aeba695

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Lib/test/test_fileio.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
from weakref import proxy
1010
from functools import wraps
1111

12-
from test.support import cpython_only, swap_attr, gc_collect
12+
from test.support import (
13+
cpython_only, swap_attr, gc_collect, is_emscripten, is_wasi
14+
)
1315
from test.support.os_helper import (TESTFN, TESTFN_UNICODE, make_bad_fd)
1416
from test.support.warnings_helper import check_warnings
1517
from collections import UserList
@@ -65,6 +67,7 @@ def testAttributes(self):
6567
self.assertRaises((AttributeError, TypeError),
6668
setattr, f, attr, 'oops')
6769

70+
@unittest.skipIf(is_wasi, "WASI does not expose st_blksize.")
6871
def testBlksize(self):
6972
# test private _blksize attribute
7073
blksize = io.DEFAULT_BUFFER_SIZE
@@ -415,7 +418,7 @@ def testAbles(self):
415418
self.assertEqual(f.isatty(), False)
416419
f.close()
417420

418-
if sys.platform != "win32":
421+
if sys.platform != "win32" and not is_emscripten:
419422
try:
420423
f = self.FileIO("/dev/tty", "a")
421424
except OSError:

0 commit comments

Comments
 (0)