From: Brett Cannon Date: Fri, 23 Jul 2010 15:50:52 +0000 (+0000) Subject: Add more tests for the threading.Thread.repr. X-Git-Tag: v3.2a1~131 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3f5f226ba0dab128f6a1b7ae534b1c29eb5db0e9;p=python Add more tests for the threading.Thread.repr. Partially closes issue 9346. Thanks to Brian Brazil for the patch. --- diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py index 5ebc482c44..201bfcb180 100644 --- a/Lib/test/test_threading.py +++ b/Lib/test/test_threading.py @@ -97,7 +97,8 @@ class ThreadTests(BaseTestCase): self.assertTrue(not t.is_alive()) self.assertNotEqual(t.ident, 0) self.assertFalse(t.ident is None) - self.assertTrue(re.match('', repr(t))) + self.assertTrue(re.match('', + repr(t))) if verbose: print('all tasks done') self.assertEqual(numrunning.get(), 0) @@ -413,6 +414,12 @@ class ThreadTests(BaseTestCase): e.isSet() threading.activeCount() +def test_repr_daemon(self): + t = threading.Thread() + self.assertFalse('daemon' in repr(t)) + t.daemon = True + self.assertTrue('daemon' in repr(t)) + class ThreadJoinOnShutdown(BaseTestCase):