[Python-checkins] r83095 - python/branches/py3k/Lib/test/test_threading.py

Brian Curtin brian.curtin at gmail.com
Fri Jul 23 18:32:18 CEST 2010


On Fri, Jul 23, 2010 at 10:50, brett.cannon <python-checkins at python.org>wrote:

> Author: brett.cannon
> Date: Fri Jul 23 17:50:52 2010
> New Revision: 83095
>
> Log:
> Add more tests for the threading.Thread.repr.
>
> Partially closes issue 9346. Thanks to Brian Brazil for the patch.
>
>
> Modified:
>   python/branches/py3k/Lib/test/test_threading.py
>
> Modified: python/branches/py3k/Lib/test/test_threading.py
>
> ==============================================================================
> --- python/branches/py3k/Lib/test/test_threading.py     (original)
> +++ python/branches/py3k/Lib/test/test_threading.py     Fri Jul 23 17:50:52
> 2010
> @@ -97,7 +97,8 @@
>             self.assertTrue(not t.is_alive())
>             self.assertNotEqual(t.ident, 0)
>             self.assertFalse(t.ident is None)
> -            self.assertTrue(re.match('<TestThread\(.*, \w+ -?\d+\)>',
> repr(t)))
> +            self.assertTrue(re.match('<TestThread\(.*, stopped -?\d+\)>',
> +                                     repr(t)))
>         if verbose:
>             print('all tasks done')
>         self.assertEqual(numrunning.get(), 0)
> @@ -413,6 +414,12 @@
>         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):


Amaury noticed that the test wasn't tabbed over so I fixed it in r83102.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-checkins/attachments/20100723/7af5f60e/attachment.html>


More information about the Python-checkins mailing list