Issue #11223: Replace threading._info() by sys.thread_info

This commit is contained in:
Victor Stinner 2011-04-30 14:53:09 +02:00
parent fab6c70770
commit d5c355ccc7
13 changed files with 119 additions and 108 deletions

View file

@ -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.