mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
gh-114099: Add test exclusions to support running the test suite on iOS (#114889)
Add test annotations required to run the test suite on iOS (PEP 730). The majority of the change involve annotating tests that use subprocess, but are skipped on Emscripten/WASI for other reasons, and including iOS/tvOS/watchOS under the same umbrella as macOS/darwin checks. `is_apple` and `is_apple_mobile` test helpers have been added to identify *any* Apple platform, and "any Apple platform except macOS", respectively.
This commit is contained in:
parent
15f6f048a6
commit
391659b3da
31 changed files with 224 additions and 150 deletions
|
@ -1815,6 +1815,7 @@ class SubprocessTestsMixin:
|
|||
else:
|
||||
self.assertEqual(-signal.SIGKILL, returncode)
|
||||
|
||||
@support.requires_subprocess()
|
||||
def test_subprocess_exec(self):
|
||||
prog = os.path.join(os.path.dirname(__file__), 'echo.py')
|
||||
|
||||
|
@ -1836,6 +1837,7 @@ class SubprocessTestsMixin:
|
|||
self.check_killed(proto.returncode)
|
||||
self.assertEqual(b'Python The Winner', proto.data[1])
|
||||
|
||||
@support.requires_subprocess()
|
||||
def test_subprocess_interactive(self):
|
||||
prog = os.path.join(os.path.dirname(__file__), 'echo.py')
|
||||
|
||||
|
@ -1863,6 +1865,7 @@ class SubprocessTestsMixin:
|
|||
self.loop.run_until_complete(proto.completed)
|
||||
self.check_killed(proto.returncode)
|
||||
|
||||
@support.requires_subprocess()
|
||||
def test_subprocess_shell(self):
|
||||
connect = self.loop.subprocess_shell(
|
||||
functools.partial(MySubprocessProtocol, self.loop),
|
||||
|
@ -1879,6 +1882,7 @@ class SubprocessTestsMixin:
|
|||
self.assertEqual(proto.data[2], b'')
|
||||
transp.close()
|
||||
|
||||
@support.requires_subprocess()
|
||||
def test_subprocess_exitcode(self):
|
||||
connect = self.loop.subprocess_shell(
|
||||
functools.partial(MySubprocessProtocol, self.loop),
|
||||
|
@ -1890,6 +1894,7 @@ class SubprocessTestsMixin:
|
|||
self.assertEqual(7, proto.returncode)
|
||||
transp.close()
|
||||
|
||||
@support.requires_subprocess()
|
||||
def test_subprocess_close_after_finish(self):
|
||||
connect = self.loop.subprocess_shell(
|
||||
functools.partial(MySubprocessProtocol, self.loop),
|
||||
|
@ -1904,6 +1909,7 @@ class SubprocessTestsMixin:
|
|||
self.assertEqual(7, proto.returncode)
|
||||
self.assertIsNone(transp.close())
|
||||
|
||||
@support.requires_subprocess()
|
||||
def test_subprocess_kill(self):
|
||||
prog = os.path.join(os.path.dirname(__file__), 'echo.py')
|
||||
|
||||
|
@ -1920,6 +1926,7 @@ class SubprocessTestsMixin:
|
|||
self.check_killed(proto.returncode)
|
||||
transp.close()
|
||||
|
||||
@support.requires_subprocess()
|
||||
def test_subprocess_terminate(self):
|
||||
prog = os.path.join(os.path.dirname(__file__), 'echo.py')
|
||||
|
||||
|
@ -1937,6 +1944,7 @@ class SubprocessTestsMixin:
|
|||
transp.close()
|
||||
|
||||
@unittest.skipIf(sys.platform == 'win32', "Don't have SIGHUP")
|
||||
@support.requires_subprocess()
|
||||
def test_subprocess_send_signal(self):
|
||||
# bpo-31034: Make sure that we get the default signal handler (killing
|
||||
# the process). The parent process may have decided to ignore SIGHUP,
|
||||
|
@ -1961,6 +1969,7 @@ class SubprocessTestsMixin:
|
|||
finally:
|
||||
signal.signal(signal.SIGHUP, old_handler)
|
||||
|
||||
@support.requires_subprocess()
|
||||
def test_subprocess_stderr(self):
|
||||
prog = os.path.join(os.path.dirname(__file__), 'echo2.py')
|
||||
|
||||
|
@ -1982,6 +1991,7 @@ class SubprocessTestsMixin:
|
|||
self.assertTrue(proto.data[2].startswith(b'ERR:test'), proto.data[2])
|
||||
self.assertEqual(0, proto.returncode)
|
||||
|
||||
@support.requires_subprocess()
|
||||
def test_subprocess_stderr_redirect_to_stdout(self):
|
||||
prog = os.path.join(os.path.dirname(__file__), 'echo2.py')
|
||||
|
||||
|
@ -2007,6 +2017,7 @@ class SubprocessTestsMixin:
|
|||
transp.close()
|
||||
self.assertEqual(0, proto.returncode)
|
||||
|
||||
@support.requires_subprocess()
|
||||
def test_subprocess_close_client_stream(self):
|
||||
prog = os.path.join(os.path.dirname(__file__), 'echo3.py')
|
||||
|
||||
|
@ -2041,6 +2052,7 @@ class SubprocessTestsMixin:
|
|||
self.loop.run_until_complete(proto.completed)
|
||||
self.check_killed(proto.returncode)
|
||||
|
||||
@support.requires_subprocess()
|
||||
def test_subprocess_wait_no_same_group(self):
|
||||
# start the new process in a new session
|
||||
connect = self.loop.subprocess_shell(
|
||||
|
@ -2053,6 +2065,7 @@ class SubprocessTestsMixin:
|
|||
self.assertEqual(7, proto.returncode)
|
||||
transp.close()
|
||||
|
||||
@support.requires_subprocess()
|
||||
def test_subprocess_exec_invalid_args(self):
|
||||
async def connect(**kwds):
|
||||
await self.loop.subprocess_exec(
|
||||
|
@ -2066,6 +2079,7 @@ class SubprocessTestsMixin:
|
|||
with self.assertRaises(ValueError):
|
||||
self.loop.run_until_complete(connect(shell=True))
|
||||
|
||||
@support.requires_subprocess()
|
||||
def test_subprocess_shell_invalid_args(self):
|
||||
|
||||
async def connect(cmd=None, **kwds):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue