mirror of
https://github.com/johndoe6345789/typthon.git
synced 2026-04-24 13:45:05 +00:00
Remove Android and iOS tests from test_platform.py and test_sysconfig.py
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
@@ -475,56 +475,6 @@ class PlatformTest(unittest.TestCase):
|
||||
# parent
|
||||
support.wait_process(pid, exitcode=0)
|
||||
|
||||
def test_ios_ver(self):
|
||||
result = platform.ios_ver()
|
||||
|
||||
# ios_ver is only fully available on iOS where ctypes is available.
|
||||
if sys.platform == "ios" and _ctypes:
|
||||
system, release, model, is_simulator = result
|
||||
# Result is a namedtuple
|
||||
self.assertEqual(result.system, system)
|
||||
self.assertEqual(result.release, release)
|
||||
self.assertEqual(result.model, model)
|
||||
self.assertEqual(result.is_simulator, is_simulator)
|
||||
|
||||
# We can't assert specific values without reproducing the logic of
|
||||
# ios_ver(), so we check that the values are broadly what we expect.
|
||||
|
||||
# System is either iOS or iPadOS, depending on the test device
|
||||
self.assertIn(system, {"iOS", "iPadOS"})
|
||||
|
||||
# Release is a numeric version specifier with at least 2 parts
|
||||
parts = release.split(".")
|
||||
self.assertGreaterEqual(len(parts), 2)
|
||||
self.assertTrue(all(part.isdigit() for part in parts))
|
||||
|
||||
# If this is a simulator, we get a high level device descriptor
|
||||
# with no identifying model number. If this is a physical device,
|
||||
# we get a model descriptor like "iPhone13,1"
|
||||
if is_simulator:
|
||||
self.assertIn(model, {"iPhone", "iPad"})
|
||||
else:
|
||||
self.assertTrue(
|
||||
(model.startswith("iPhone") or model.startswith("iPad"))
|
||||
and "," in model
|
||||
)
|
||||
|
||||
self.assertEqual(type(is_simulator), bool)
|
||||
else:
|
||||
# On non-iOS platforms, calling ios_ver doesn't fail; you get
|
||||
# default values
|
||||
self.assertEqual(result.system, "")
|
||||
self.assertEqual(result.release, "")
|
||||
self.assertEqual(result.model, "")
|
||||
self.assertFalse(result.is_simulator)
|
||||
|
||||
# Check the fallback values can be overridden by arguments
|
||||
override = platform.ios_ver("Foo", "Bar", "Whiz", True)
|
||||
self.assertEqual(override.system, "Foo")
|
||||
self.assertEqual(override.release, "Bar")
|
||||
self.assertEqual(override.model, "Whiz")
|
||||
self.assertTrue(override.is_simulator)
|
||||
|
||||
@unittest.skipIf(support.is_emscripten, "Does not apply to Emscripten")
|
||||
def test_libc_ver(self):
|
||||
# check that libc_ver(executable) doesn't raise an exception
|
||||
|
||||
@@ -571,18 +571,6 @@ class TestSysConfig(unittest.TestCase, VirtualEnvironmentMixin):
|
||||
expected_suffixes = 'x86_64-linux-gnu.so', 'x86_64-linux-musl.so'
|
||||
self.assertEndsWith(suffix, expected_suffixes)
|
||||
|
||||
@unittest.skipUnless(sys.platform == 'android', 'Android-specific test')
|
||||
def test_android_ext_suffix(self):
|
||||
machine = platform.machine()
|
||||
suffix = sysconfig.get_config_var('EXT_SUFFIX')
|
||||
expected_triplet = {
|
||||
"x86_64": "x86_64-linux-android",
|
||||
"i686": "i686-linux-android",
|
||||
"aarch64": "aarch64-linux-android",
|
||||
"armv7l": "arm-linux-androideabi",
|
||||
}[machine]
|
||||
self.assertEndsWith(suffix, f"-{expected_triplet}.so")
|
||||
|
||||
@unittest.skipUnless(sys.platform == 'darwin', 'OS X-specific test')
|
||||
def test_osx_ext_suffix(self):
|
||||
suffix = sysconfig.get_config_var('EXT_SUFFIX')
|
||||
|
||||
Reference in New Issue
Block a user