From 425d822a10ed84425ac9ef4bf2f954e3793192f7 2014-09-26 19:01:58 From: Thomas Kluyver Date: 2014-09-26 19:01:58 Subject: [PATCH] Backport PR #6556: Use some more informative asserts in inprocess kernel tests Prompted by gh-6552 (but doesn't fix it) --- diff --git a/IPython/kernel/inprocess/tests/test_kernel.py b/IPython/kernel/inprocess/tests/test_kernel.py index e817d3a..0677112 100644 --- a/IPython/kernel/inprocess/tests/test_kernel.py +++ b/IPython/kernel/inprocess/tests/test_kernel.py @@ -46,7 +46,7 @@ class InProcessKernelTestCase(unittest.TestCase): kc = self.kc kc.execute('%pylab') msg = get_stream_message(kc) - self.assert_('matplotlib' in msg['content']['data']) + self.assertIn('matplotlib', msg['content']['data']) def test_raw_input(self): """ Does the in-process kernel handle raw_input correctly? diff --git a/IPython/kernel/inprocess/tests/test_kernelmanager.py b/IPython/kernel/inprocess/tests/test_kernelmanager.py index ec07d07..847fe4d 100644 --- a/IPython/kernel/inprocess/tests/test_kernelmanager.py +++ b/IPython/kernel/inprocess/tests/test_kernelmanager.py @@ -41,7 +41,7 @@ class InProcessKernelManagerTestCase(unittest.TestCase): old_kernel = km.kernel km.restart_kernel() - self.assert_(km.kernel is not None) + self.assertIsNotNone(km.kernel) self.assertNotEquals(km.kernel, old_kernel) km.shutdown_kernel()