[Python-Dev] [Python-checkins] cpython: Skip some more tests in the absence of threading.

Éric Araujo merwok at netwok.org
Wed May 18 18:47:49 CEST 2011


> http://hg.python.org/cpython/rev/c83fb59b73ea
> user:        Vinay Sajip <vinay_sajip at yahoo.co.uk>
> date:        Tue May 17 07:15:53 2011 +0100
> summary:
>   Skip some more tests in the absence of threading

> diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py
> --- a/Lib/test/test_logging.py
> +++ b/Lib/test/test_logging.py
>  try:
>      import threading
> +    # The following imports are needed only for tests which
> +    import asynchat
I guess “for tests which use threading”

> +if threading:
> +    class TestSMTPChannel(smtpd.SMTPChannel):
I wonder if you could have saved yourself all this reindenting if your
import had fallen back to dummy_threading.

> + at unittest.skipUnless(threading, 'Threading required for this test.')
I’d have used lower-case threading, to make it a bit clearer that it’s
the threading module that’s require, not some abstract notion of
threading.  But they may be the same thing, I’m not sure.


More information about the Python-Dev mailing list