From 8bc32ebe5e41ef16926814c007050cd910725113 Mon Sep 17 00:00:00 2001 From: Andrey Maltsev Date: Sun, 2 Apr 2023 14:46:20 +0000 Subject: [PATCH] Update test_fileio.py from Cpython v3.11.2 --- Lib/test/test_fileio.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_fileio.py b/Lib/test/test_fileio.py index 200b8ce773..a1a6a245c6 100644 --- a/Lib/test/test_fileio.py +++ b/Lib/test/test_fileio.py @@ -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 @@ -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 @@ -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: