diff --git a/IPython/config/tests/test_configurable.py b/IPython/config/tests/test_configurable.py index acc41f5..dc13804 100644 --- a/IPython/config/tests/test_configurable.py +++ b/IPython/config/tests/test_configurable.py @@ -97,11 +97,11 @@ class TestConfigurable(TestCase): self.assertEqual(c2.config, config) self.assertEqual(c3.config, config) # Test that copies are not made - self.assert_(c1.config is config) - self.assert_(c2.config is config) - self.assert_(c3.config is config) - self.assert_(c1.config is c2.config) - self.assert_(c2.config is c3.config) + self.assertTrue(c1.config is config) + self.assertTrue(c2.config is config) + self.assertTrue(c3.config is config) + self.assertTrue(c1.config is c2.config) + self.assertTrue(c2.config is c3.config) def test_inheritance(self): config = Config() diff --git a/IPython/config/tests/test_loader.py b/IPython/config/tests/test_loader.py index bcb0be6..ffb94b8 100644 --- a/IPython/config/tests/test_loader.py +++ b/IPython/config/tests/test_loader.py @@ -253,8 +253,8 @@ class TestConfig(TestCase): import copy c2 = copy.deepcopy(c1) self.assertEqual(c1, c2) - self.assert_(c1 is not c2) - self.assert_(c1.Foo is not c2.Foo) + self.assertTrue(c1 is not c2) + self.assertTrue(c1.Foo is not c2.Foo) def test_builtin(self): c1 = Config() diff --git a/IPython/frontend/html/notebook/tests/test_kernelsession.py b/IPython/frontend/html/notebook/tests/test_kernelsession.py index 032c226..1b513f0 100644 --- a/IPython/frontend/html/notebook/tests/test_kernelsession.py +++ b/IPython/frontend/html/notebook/tests/test_kernelsession.py @@ -9,18 +9,18 @@ class TestKernelManager(TestCase): def test_km_lifecycle(self): km = MultiKernelManager() kid = km.start_kernel() - self.assert_(kid in km) + self.assertTrue(kid in km) self.assertEqual(len(km),1) km.kill_kernel(kid) - self.assert_(not kid in km) + self.assertTrue(not kid in km) kid = km.start_kernel() self.assertEqual('127.0.0.1',km.get_kernel_ip(kid)) port_dict = km.get_kernel_ports(kid) - self.assert_('stdin_port' in port_dict) - self.assert_('iopub_port' in port_dict) - self.assert_('shell_port' in port_dict) - self.assert_('hb_port' in port_dict) + self.assertTrue('stdin_port' in port_dict) + self.assertTrue('iopub_port' in port_dict) + self.assertTrue('shell_port' in port_dict) + self.assertTrue('hb_port' in port_dict) km.get_kernel(kid) km.kill_kernel(kid) diff --git a/IPython/frontend/qt/console/tests/test_kill_ring.py b/IPython/frontend/qt/console/tests/test_kill_ring.py index e75a86b..32c41c6 100644 --- a/IPython/frontend/qt/console/tests/test_kill_ring.py +++ b/IPython/frontend/qt/console/tests/test_kill_ring.py @@ -29,12 +29,12 @@ class TestKillRing(unittest.TestCase): """ Does the generic kill ring work? """ ring = KillRing() - self.assert_(ring.yank() is None) - self.assert_(ring.rotate() is None) + self.assertTrue(ring.yank() is None) + self.assertTrue(ring.rotate() is None) ring.kill('foo') self.assertEqual(ring.yank(), 'foo') - self.assert_(ring.rotate() is None) + self.assertTrue(ring.rotate() is None) self.assertEqual(ring.yank(), 'foo') ring.kill('bar') @@ -42,8 +42,8 @@ class TestKillRing(unittest.TestCase): self.assertEqual(ring.rotate(), 'foo') ring.clear() - self.assert_(ring.yank() is None) - self.assert_(ring.rotate() is None) + self.assertTrue(ring.yank() is None) + self.assertTrue(ring.rotate() is None) def test_qt_basic(self): """ Does the Qt kill ring work? diff --git a/IPython/lib/tests/test_irunner.py b/IPython/lib/tests/test_irunner.py index e3ef861..2ffd755 100644 --- a/IPython/lib/tests/test_irunner.py +++ b/IPython/lib/tests/test_irunner.py @@ -55,8 +55,8 @@ class RunnerTestCase(unittest.TestCase): print(repr(ol1)) print(repr(ol2)) print('>>>') - self.assert_(mismatch==0,'Number of mismatched lines: %s' % - mismatch) + self.assertTrue(mismatch==0,'Number of mismatched lines: %s' % + mismatch) def testIPython(self): """Test the IPython runner.""" diff --git a/IPython/lib/tests/test_irunner_pylab_magic.py b/IPython/lib/tests/test_irunner_pylab_magic.py index 788637b..7132eb6 100644 --- a/IPython/lib/tests/test_irunner_pylab_magic.py +++ b/IPython/lib/tests/test_irunner_pylab_magic.py @@ -63,8 +63,8 @@ class RunnerTestCase(unittest.TestCase): print(repr(ol1)) print(repr(ol2)) print('>>>') - self.assert_(mismatch==0,'Number of mismatched lines: %s' % - mismatch) + self.assertTrue(mismatch==0,'Number of mismatched lines: %s' % + mismatch) @decorators.skipif_not_matplotlib @decorators.skipif(pylab_not_importable, "Likely a run without X.") diff --git a/IPython/parallel/tests/test_client.py b/IPython/parallel/tests/test_client.py index f57c23b..6e4080d 100644 --- a/IPython/parallel/tests/test_client.py +++ b/IPython/parallel/tests/test_client.py @@ -50,23 +50,23 @@ class TestClient(ClusterTestCase): self.assertEqual(v.targets, targets) t = self.client.ids[2] v = self.client[t] - self.assert_(isinstance(v, DirectView)) + self.assertTrue(isinstance(v, DirectView)) self.assertEqual(v.targets, t) t = self.client.ids[2:4] v = self.client[t] - self.assert_(isinstance(v, DirectView)) + self.assertTrue(isinstance(v, DirectView)) self.assertEqual(v.targets, t) v = self.client[::2] - self.assert_(isinstance(v, DirectView)) + self.assertTrue(isinstance(v, DirectView)) self.assertEqual(v.targets, targets[::2]) v = self.client[1::3] - self.assert_(isinstance(v, DirectView)) + self.assertTrue(isinstance(v, DirectView)) self.assertEqual(v.targets, targets[1::3]) v = self.client[:-3] - self.assert_(isinstance(v, DirectView)) + self.assertTrue(isinstance(v, DirectView)) self.assertEqual(v.targets, targets[:-3]) v = self.client[-1] - self.assert_(isinstance(v, DirectView)) + self.assertTrue(isinstance(v, DirectView)) self.assertEqual(v.targets, targets[-1]) self.assertRaises(TypeError, lambda : self.client[None]) diff --git a/IPython/utils/tests/test_notification.py b/IPython/utils/tests/test_notification.py index d710509..7a58d9e 100644 --- a/IPython/utils/tests/test_notification.py +++ b/IPython/utils/tests/test_notification.py @@ -117,11 +117,11 @@ class NotificationTests(unittest.TestCase): for i in xrange(10): Observer('TYPE', None, center=shared_center) - self.assert_(len(shared_center.observers[('TYPE',None)]) >= 10, + self.assertTrue(len(shared_center.observers[('TYPE',None)]) >= 10, "observers registered") shared_center.remove_all_observers() - self.assert_(len(shared_center.observers) == 0, "observers removed") + self.assertTrue(len(shared_center.observers) == 0, "observers removed") def test_any_sender(self): expected_ntype = "EXPECTED_TYPE" diff --git a/IPython/utils/tests/test_traitlets.py b/IPython/utils/tests/test_traitlets.py index a056efe..ef9024b 100644 --- a/IPython/utils/tests/test_traitlets.py +++ b/IPython/utils/tests/test_traitlets.py @@ -237,9 +237,9 @@ class TestHasTraitsNotify(TestCase): a.b = 0.0 self.assertEqual(len(self._notify1),0) a.a = 10 - self.assert_(('a',0,10) in self._notify1) + self.assertTrue(('a',0,10) in self._notify1) a.b = 10.0 - self.assert_(('b',0.0,10.0) in self._notify1) + self.assertTrue(('b',0.0,10.0) in self._notify1) self.assertRaises(TraitError,setattr,a,'a','bad string') self.assertRaises(TraitError,setattr,a,'b','bad string') self._notify1 = [] @@ -259,7 +259,7 @@ class TestHasTraitsNotify(TestCase): a.a = 0 self.assertEqual(len(self._notify1),0) a.a = 10 - self.assert_(('a',0,10) in self._notify1) + self.assertTrue(('a',0,10) in self._notify1) self.assertRaises(TraitError,setattr,a,'a','bad string') def test_subclass(self): @@ -295,8 +295,8 @@ class TestHasTraitsNotify(TestCase): self.assertEqual(len(self._notify2),0) b.a = 10 b.b = 10.0 - self.assert_(('a',0,10) in self._notify1) - self.assert_(('b',0.0,10.0) in self._notify2) + self.assertTrue(('a',0,10) in self._notify1) + self.assertTrue(('b',0.0,10.0) in self._notify2) def test_static_notify(self): @@ -311,7 +311,7 @@ class TestHasTraitsNotify(TestCase): # This is broken!!! self.assertEqual(len(a._notify1),0) a.a = 10 - self.assert_(('a',0,10) in a._notify1) + self.assertTrue(('a',0,10) in a._notify1) class B(A): b = Float @@ -322,8 +322,8 @@ class TestHasTraitsNotify(TestCase): b = B() b.a = 10 b.b = 10.0 - self.assert_(('a',0,10) in b._notify1) - self.assert_(('b',0.0,10.0) in b._notify2) + self.assertTrue(('a',0,10) in b._notify1) + self.assertTrue(('b',0.0,10.0) in b._notify2) def test_notify_args(self): @@ -504,11 +504,11 @@ class TestInstance(TestCase): inst = Instance(Foo) a = A() - self.assert_(a.inst is None) + self.assertTrue(a.inst is None) a.inst = Foo() - self.assert_(isinstance(a.inst, Foo)) + self.assertTrue(isinstance(a.inst, Foo)) a.inst = Bar() - self.assert_(isinstance(a.inst, Foo)) + self.assertTrue(isinstance(a.inst, Foo)) self.assertRaises(TraitError, setattr, a, 'inst', Foo) self.assertRaises(TraitError, setattr, a, 'inst', Bar) self.assertRaises(TraitError, setattr, a, 'inst', Bah()) @@ -520,7 +520,7 @@ class TestInstance(TestCase): a = A() b = A() - self.assert_(a.inst is not b.inst) + self.assertTrue(a.inst is not b.inst) def test_args_kw(self): class Foo(object): @@ -544,7 +544,7 @@ class TestInstance(TestCase): class C(HasTraits): inst = Instance(Foo) c = C() - self.assert_(c.inst is None) + self.assertTrue(c.inst is None) def test_bad_default(self): class Foo(object): pass @@ -583,7 +583,7 @@ class TestThis(TestCase): f = Foo() f.this = Foo() - self.assert_(isinstance(f.this, Foo)) + self.assertTrue(isinstance(f.this, Foo)) def test_subclass(self): class Foo(HasTraits):