diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-12-02 00:13:46 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-12-02 00:13:46 (GMT) |
commit | d6958ac6c0fec90524bf9c4999c8bc75fff0c71b (patch) | |
tree | 93f5e47349d8b51b9cec9f2c1710b8dc1e13c98b /Lib/test/test_sys.py | |
parent | edfe8869c8e888e676091c87330b3bf0f3d9814b (diff) | |
download | cpython-d6958ac6c0fec90524bf9c4999c8bc75fff0c71b.zip cpython-d6958ac6c0fec90524bf9c4999c8bc75fff0c71b.tar.gz cpython-d6958ac6c0fec90524bf9c4999c8bc75fff0c71b.tar.bz2 |
Add sys.getandroidapilevel()
Issue #28740: Add sys.getandroidapilevel(): return the build time
API version of Android as an integer.
Function only available on Android.
Diffstat (limited to 'Lib/test/test_sys.py')
-rw-r--r-- | Lib/test/test_sys.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py index df9ebd4..828421c 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -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): |