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:
Russell Keith-Magee 2024-02-05 08:04:57 +08:00 committed by GitHub
parent 15f6f048a6
commit 391659b3da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
31 changed files with 224 additions and 150 deletions

View file

@ -2,8 +2,7 @@ import unittest
import os
import socket
import sys
from test.support import os_helper
from test.support import socket_helper
from test.support import is_apple, os_helper, socket_helper
from test.support.import_helper import import_fresh_module
from test.support.os_helper import TESTFN
@ -247,7 +246,7 @@ class TestFilemode:
for flag in self.file_flags:
if flag.startswith("UF"):
self.assertTrue(getattr(self.statmod, flag) & self.statmod.UF_SETTABLE, f"{flag} not in UF_SETTABLE")
elif sys.platform == 'darwin' and self.statmod is c_stat and flag == 'SF_DATALESS':
elif is_apple and self.statmod is c_stat and flag == 'SF_DATALESS':
self.assertTrue(self.statmod.SF_DATALESS & self.statmod.SF_SYNTHETIC, "SF_DATALESS not in SF_SYNTHETIC")
self.assertFalse(self.statmod.SF_DATALESS & self.statmod.SF_SETTABLE, "SF_DATALESS in SF_SETTABLE")
else: