diff options
Diffstat (limited to 'Lib/test/test_abc.py')
-rw-r--r-- | Lib/test/test_abc.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/Lib/test/test_abc.py b/Lib/test/test_abc.py index 718d903..529f3e6 100644 --- a/Lib/test/test_abc.py +++ b/Lib/test/test_abc.py @@ -89,20 +89,20 @@ class TestABC(unittest.TestCase): b = B() self.assertEqual(issubclass(B, A), False) self.assertEqual(issubclass(B, (A,)), False) - self.assertEqual(isinstance(b, A), False) - self.assertEqual(isinstance(b, (A,)), False) + self.assertNotIsInstance(b, A) + self.assertNotIsInstance(b, (A,)) A.register(B) self.assertEqual(issubclass(B, A), True) self.assertEqual(issubclass(B, (A,)), True) - self.assertEqual(isinstance(b, A), True) - self.assertEqual(isinstance(b, (A,)), True) + self.assertIsInstance(b, A) + self.assertIsInstance(b, (A,)) class C(B): pass c = C() self.assertEqual(issubclass(C, A), True) self.assertEqual(issubclass(C, (A,)), True) - self.assertEqual(isinstance(c, A), True) - self.assertEqual(isinstance(c, (A,)), True) + self.assertIsInstance(c, A) + self.assertIsInstance(c, (A,)) def test_isinstance_invalidation(self): class A: @@ -120,15 +120,15 @@ class TestABC(unittest.TestCase): class A: __metaclass__ = abc.ABCMeta A.register(int) - self.assertEqual(isinstance(42, A), True) - self.assertEqual(isinstance(42, (A,)), True) + self.assertIsInstance(42, A) + self.assertIsInstance(42, (A,)) self.assertEqual(issubclass(int, A), True) self.assertEqual(issubclass(int, (A,)), True) class B(A): pass B.register(basestring) - self.assertEqual(isinstance("", A), True) - self.assertEqual(isinstance("", (A,)), True) + self.assertIsInstance("", A) + self.assertIsInstance("", (A,)) self.assertEqual(issubclass(str, A), True) self.assertEqual(issubclass(str, (A,)), True) @@ -185,8 +185,8 @@ class TestABC(unittest.TestCase): pass self.assertTrue(issubclass(MyInt, A)) self.assertTrue(issubclass(MyInt, (A,))) - self.assertTrue(isinstance(42, A)) - self.assertTrue(isinstance(42, (A,))) + self.assertIsInstance(42, A) + self.assertIsInstance(42, (A,)) def test_all_new_methods_are_called(self): class A: |