summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_descr.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_descr.py')
-rw-r--r--Lib/test/test_descr.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index 354f079..ab5a1ea 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -410,11 +410,11 @@ class ClassPropertiesAndMethods(unittest.TestCase):
def test_python_dicts(self):
# Testing Python subclass of dict...
self.assertTrue(issubclass(dict, dict))
- self.assertTrue(isinstance({}, dict))
+ self.assertIsInstance({}, dict)
d = dict()
self.assertEqual(d, {})
self.assertTrue(d.__class__ is dict)
- self.assertTrue(isinstance(d, dict))
+ self.assertIsInstance(d, dict)
class C(dict):
state = -1
def __init__(self_local, *a, **kw):
@@ -427,7 +427,7 @@ class ClassPropertiesAndMethods(unittest.TestCase):
def __getitem__(self, key):
return self.get(key, 0)
def __setitem__(self_local, key, value):
- self.assertTrue(isinstance(key, type(0)))
+ self.assertIsInstance(key, type(0))
dict.__setitem__(self_local, key, value)
def setstate(self, state):
self.state = state
@@ -1222,7 +1222,7 @@ order (MRO) for bases """
MyABC.register(Unrelated)
u = Unrelated()
- self.assertTrue(isinstance(u, MyABC))
+ self.assertIsInstance(u, MyABC)
# This used to crash
self.assertRaises(TypeError, MyABC.a.__set__, u, 3)
@@ -2025,7 +2025,7 @@ order (MRO) for bases """
self.assertFalse(hasattr(a, "x"))
raw = C.__dict__['x']
- self.assertTrue(isinstance(raw, property))
+ self.assertIsInstance(raw, property)
attrs = dir(raw)
self.assertIn("__doc__", attrs)
@@ -4237,29 +4237,29 @@ order (MRO) for bases """
pass
a = C()
pa = Proxy(a)
- self.assertTrue(isinstance(a, C)) # Baseline
- self.assertTrue(isinstance(pa, C)) # Test
+ self.assertIsInstance(a, C) # Baseline
+ self.assertIsInstance(pa, C) # Test
# Test with a classic subclass
class D(C):
pass
a = D()
pa = Proxy(a)
- self.assertTrue(isinstance(a, C)) # Baseline
- self.assertTrue(isinstance(pa, C)) # Test
+ self.assertIsInstance(a, C) # Baseline
+ self.assertIsInstance(pa, C) # Test
# Test with a new-style class
class C(object):
pass
a = C()
pa = Proxy(a)
- self.assertTrue(isinstance(a, C)) # Baseline
- self.assertTrue(isinstance(pa, C)) # Test
+ self.assertIsInstance(a, C) # Baseline
+ self.assertIsInstance(pa, C) # Test
# Test with a new-style subclass
class D(C):
pass
a = D()
pa = Proxy(a)
- self.assertTrue(isinstance(a, C)) # Baseline
- self.assertTrue(isinstance(pa, C)) # Test
+ self.assertIsInstance(a, C) # Baseline
+ self.assertIsInstance(pa, C) # Test
def test_proxy_super(self):
# Testing super() for a proxy object...