bpo-36084: Add native thread ID to threading.Thread objects (GH-11993)

This commit is contained in:
Jake Tesler 2019-05-12 10:08:24 -07:00 committed by Antoine Pitrou
parent 87068ed009
commit 4959c33d25
10 changed files with 133 additions and 2 deletions

View file

@ -104,6 +104,10 @@ class ThreadTests(BaseTestCase):
self.assertRegex(repr(t), r'^<TestThread\(.*, initial\)>$')
t.start()
native_ids = set(t.native_id for t in threads) | {threading.get_native_id()}
self.assertNotIn(None, native_ids)
self.assertEqual(len(native_ids), NUMTASKS + 1)
if verbose:
print('waiting for all tasks to complete')
for t in threads: