cpython: 4b7c29201c60 (original) (raw)
Mercurial > cpython
changeset 70170:4b7c29201c60
Skip some tests in the absence of multiprocessing.
Vinay Sajip <vinay_sajip@yahoo.co.uk> | |
---|---|
date | Tue, 17 May 2011 07:41:18 +0100 |
parents | c83fb59b73ea |
children | 3d7cb852a176 |
files | Lib/test/test_logging.py |
diffstat | 1 files changed, 11 insertions(+), 5 deletions(-)[+] [-] Lib/test/test_logging.py 16 |
line wrap: on
line diff
--- 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[](#l1.23)
r = logging.makeLogRecord({})[](#l1.24)
self.assertEqual(r.processName, mp.current_process().name)[](#l1.25)
try:[](#l1.26)
import multiprocessing as mp[](#l1.27)
r = logging.makeLogRecord({})[](#l1.28)
self.assertEqual(r.processName, mp.current_process().name)[](#l1.29)
except ImportError:[](#l1.30)
pass[](#l1.31)
def test_optional(self): r = logging.makeLogRecord({}) NOT_NONE = self.assertIsNotNone
NOT_NONE(r.thread)[](#l1.36)
NOT_NONE(r.threadName)[](#l1.37)
if threading:[](#l1.38)
NOT_NONE(r.thread)[](#l1.39)
NOT_NONE(r.threadName)[](#l1.40) NOT_NONE(r.process)[](#l1.41) NOT_NONE(r.processName)[](#l1.42) log_threads = logging.logThreads[](#l1.43)