diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2011-05-17 06:41:18 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2011-05-17 06:41:18 (GMT) |
commit | bd3d5cf96af2b56ed55773a57e850f165ffe3836 (patch) | |
tree | 9d1708c747e2e19207fcfa32bcc9431297c3df34 /Lib | |
parent | ce7c978140bb872c9efd0cc18ca12c0b7dc0f1f5 (diff) | |
download | cpython-bd3d5cf96af2b56ed55773a57e850f165ffe3836.zip cpython-bd3d5cf96af2b56ed55773a57e850f165ffe3836.tar.gz cpython-bd3d5cf96af2b56ed55773a57e850f165ffe3836.tar.bz2 |
Skip some tests in the absence of multiprocessing.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_logging.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index 417b76c..24a6149 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -2504,6 +2504,7 @@ class ConfigDictTest(BaseTest): logging.config.stopListening() t.join(2.0) + @unittest.skipUnless(threading, 'Threading required for this test.') def test_listen_config_10_ok(self): with captured_stdout() as output: self.setup_via_listener(json.dumps(self.config10)) @@ -2523,6 +2524,7 @@ class ConfigDictTest(BaseTest): ('ERROR', '4'), ], stream=output) + @unittest.skipUnless(threading, 'Threading required for this test.') def test_listen_config_1_ok(self): with captured_stdout() as output: self.setup_via_listener(textwrap.dedent(ConfigFileTest.config1)) @@ -3062,15 +3064,19 @@ class LogRecordTest(BaseTest): def test_multiprocessing(self): r = logging.makeLogRecord({}) self.assertEqual(r.processName, 'MainProcess') - import multiprocessing as mp - r = logging.makeLogRecord({}) - self.assertEqual(r.processName, mp.current_process().name) + try: + import multiprocessing as mp + r = logging.makeLogRecord({}) + self.assertEqual(r.processName, mp.current_process().name) + except ImportError: + pass def test_optional(self): r = logging.makeLogRecord({}) NOT_NONE = self.assertIsNotNone - NOT_NONE(r.thread) - NOT_NONE(r.threadName) + if threading: + NOT_NONE(r.thread) + NOT_NONE(r.threadName) NOT_NONE(r.process) NOT_NONE(r.processName) log_threads = logging.logThreads |