summaryrefslogtreecommitdiff
path: root/Lib/test/test_sys.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-04-30 14:53:09 +0200
committerVictor Stinner <victor.stinner@haypocalc.com>2011-04-30 14:53:09 +0200
commitd5c355ccc70d011ef2010537838d9a82e24b2b80 (patch)
tree93cd12a87150e673d0a8b16c04ffcaff16fea3aa /Lib/test/test_sys.py
parentfab6c70770c7c895a4dbd898a963e2c52da72c04 (diff)
downloadcpython-git-d5c355ccc70d011ef2010537838d9a82e24b2b80.tar.gz
Issue #11223: Replace threading._info() by sys.thread_info
Diffstat (limited to 'Lib/test/test_sys.py')
-rw-r--r--Lib/test/test_sys.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py
index e18019c15c..61b2676c44 100644
--- a/Lib/test/test_sys.py
+++ b/Lib/test/test_sys.py
@@ -474,6 +474,14 @@ class SysModuleTest(unittest.TestCase):
if not sys.platform.startswith('win'):
self.assertIsInstance(sys.abiflags, str)
+ @unittest.skipUnless(hasattr(sys, 'thread_info'),
+ 'Threading required for this test.')
+ def test_thread_info(self):
+ info = sys.thread_info
+ self.assertTrue(len(info), 3)
+ self.assertIn(info.name, ('nt', 'os2', 'pthread', 'solaris', None))
+ self.assertIn(info.lock, ('semaphore', 'mutex+cond', None))
+
def test_43581(self):
# Can't use sys.stdout, as this is a StringIO object when
# the test runs under regrtest.