|
7 | 7 | import sys
|
8 | 8 | import unittest
|
9 | 9 | import warnings
|
| 10 | +from test.support import is_emscripten |
10 | 11 | from test.support import os_helper
|
11 | 12 | from test.support import warnings_helper
|
12 | 13 | from test.support.script_helper import assert_python_ok
|
@@ -154,6 +155,7 @@ def test_exists(self):
|
154 | 155 | self.assertIs(self.pathmodule.lexists(bfilename + b'\x00'), False)
|
155 | 156 |
|
156 | 157 | @unittest.skipUnless(hasattr(os, "pipe"), "requires os.pipe()")
|
| 158 | + @unittest.skipIf(is_emscripten, "Emscripten pipe fds have no stat") |
157 | 159 | def test_exists_fd(self):
|
158 | 160 | r, w = os.pipe()
|
159 | 161 | try:
|
@@ -246,6 +248,7 @@ def _test_samefile_on_link_func(self, func):
|
246 | 248 | def test_samefile_on_symlink(self):
|
247 | 249 | self._test_samefile_on_link_func(os.symlink)
|
248 | 250 |
|
| 251 | + @unittest.skipUnless(hasattr(os, 'link'), 'requires os.link') |
249 | 252 | def test_samefile_on_link(self):
|
250 | 253 | try:
|
251 | 254 | self._test_samefile_on_link_func(os.link)
|
@@ -288,6 +291,7 @@ def _test_samestat_on_link_func(self, func):
|
288 | 291 | def test_samestat_on_symlink(self):
|
289 | 292 | self._test_samestat_on_link_func(os.symlink)
|
290 | 293 |
|
| 294 | + @unittest.skipUnless(hasattr(os, 'link'), 'requires os.link') |
291 | 295 | def test_samestat_on_link(self):
|
292 | 296 | try:
|
293 | 297 | self._test_samestat_on_link_func(os.link)
|
@@ -476,11 +480,11 @@ def test_abspath_issue3426(self):
|
476 | 480 |
|
477 | 481 | def test_nonascii_abspath(self):
|
478 | 482 | if (os_helper.TESTFN_UNDECODABLE
|
479 |
| - # Mac OS X denies the creation of a directory with an invalid |
480 |
| - # UTF-8 name. Windows allows creating a directory with an |
| 483 | + # macOS and Emscripten deny the creation of a directory with an |
| 484 | + # invalid UTF-8 name. Windows allows creating a directory with an |
481 | 485 | # arbitrary bytes name, but fails to enter this directory
|
482 | 486 | # (when the bytes name is used).
|
483 |
| - and sys.platform not in ('win32', 'darwin')): |
| 487 | + and sys.platform not in ('win32', 'darwin', 'emscripten')): |
484 | 488 | name = os_helper.TESTFN_UNDECODABLE
|
485 | 489 | elif os_helper.TESTFN_NONASCII:
|
486 | 490 | name = os_helper.TESTFN_NONASCII
|
|
0 commit comments