summaryrefslogtreecommitdiff
path: root/Lib/test/test_threading.py
diff options
context:
space:
mode:
authorJake Tesler <jake.tesler@gmail.com>2019-05-12 10:08:24 -0700
committerAntoine Pitrou <antoine@python.org>2019-05-12 19:08:24 +0200
commit4959c33d2555b89b494c678d99be81a65ee864b0 (patch)
tree87df7778f170864ef1efe3418ac3cb3c47051c50 /Lib/test/test_threading.py
parent87068ed00927bdeaa2ae556e4241c16cf8a845eb (diff)
downloadcpython-git-4959c33d2555b89b494c678d99be81a65ee864b0.tar.gz
bpo-36084: Add native thread ID to threading.Thread objects (GH-11993)
Diffstat (limited to 'Lib/test/test_threading.py')
-rw-r--r--Lib/test/test_threading.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
index 2ddc77b266..6ac6e9de7a 100644
--- a/Lib/test/test_threading.py
+++ b/Lib/test/test_threading.py
@@ -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: