mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Add sys.getandroidapilevel()
Issue #28740: Add sys.getandroidapilevel(): return the build time API version of Android as an integer. Function only available on Android.
This commit is contained in:
parent
edfe8869c8
commit
d6958ac6c0
5 changed files with 44 additions and 2 deletions
|
@ -826,6 +826,13 @@ class SysModuleTest(unittest.TestCase):
|
|||
rc, stdout, stderr = assert_python_ok('-c', code)
|
||||
self.assertEqual(stdout.rstrip(), b'True')
|
||||
|
||||
@unittest.skipUnless(hasattr(sys, 'getandroidapilevel'),
|
||||
'need sys.getandroidapilevel()')
|
||||
def test_getandroidapilevel(self):
|
||||
level = sys.getandroidapilevel()
|
||||
self.assertIsInstance(level, int)
|
||||
self.assertGreater(level, 0)
|
||||
|
||||
|
||||
@test.support.cpython_only
|
||||
class SizeofTest(unittest.TestCase):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue