Skip to content

Commit c4750d7

Browse files
Skip tests not supported on some platforms
1 parent c8113c5 commit c4750d7

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

Lib/test/test_os/test_os.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2636,10 +2636,17 @@ def mock_execve(name, *args):
26362636

26372637
@unittest.skipUnless(hasattr(os, 'execv'),
26382638
"need os.execv()")
2639+
@unittest.skipIf(support.is_emscripten,
2640+
"Emscripten always fails with ENOEXEC")
2641+
@unittest.skipIf(support.is_android,
2642+
"PATH contains an inaccessible directory on Android")
26392643
class ExecTests(unittest.TestCase):
26402644
def _test_bad_program(self, do_exec, exc_type=OSError):
2641-
for bad_filename in ('nosuchapp', b'nosuchapp',
2642-
FakePath('nosuchapp'), FakePath(b'nosuchapp')):
2645+
bad_filenames = ['nosuchapp', FakePath('nosuchapp')]
2646+
if os.name != 'nt':
2647+
# Bytes program names are not supported on Windows.
2648+
bad_filenames += [b'nosuchapp', FakePath(b'nosuchapp')]
2649+
for bad_filename in bad_filenames:
26432650
with self.subTest(bad_filename):
26442651
with self.assertRaises(exc_type) as ctx:
26452652
do_exec(bad_filename)

0 commit comments

Comments
 (0)