gh-71052: Change Android's sys.platform from "linux" to "android"

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
This commit is contained in:
Malcolm Smith 2024-03-11 19:25:39 +00:00 committed by GitHub
parent 9f983e00ec
commit 872c0714fc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 97 additions and 81 deletions

View file

@ -668,7 +668,7 @@ class SysModuleTest(unittest.TestCase):
self.assertEqual(len(info), 3)
self.assertIn(info.name, ('nt', 'pthread', 'pthread-stubs', 'solaris', None))
self.assertIn(info.lock, ('semaphore', 'mutex+cond', None))
if sys.platform.startswith(("linux", "freebsd")):
if sys.platform.startswith(("linux", "android", "freebsd")):
self.assertEqual(info.name, "pthread")
elif sys.platform == "win32":
self.assertEqual(info.name, "nt")
@ -1101,8 +1101,7 @@ class SysModuleTest(unittest.TestCase):
self.assertEqual(stdout.rstrip(), b"")
self.assertEqual(stderr.rstrip(), b"")
@unittest.skipUnless(hasattr(sys, 'getandroidapilevel'),
'need sys.getandroidapilevel()')
@unittest.skipUnless(sys.platform == "android", "Android only")
def test_getandroidapilevel(self):
level = sys.getandroidapilevel()
self.assertIsInstance(level, int)