[Python-Dev] [Python-checkins] cpython: Skip some more tests in the absence of threading.
merwok at netwok.org
Wed May 18 18:47:49 CEST 2011
> user: Vinay Sajip <vinay_sajip at yahoo.co.uk>
> date: Tue May 17 07:15:53 2011 +0100
> 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
> 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