summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2010-08-17 01:10:45 (GMT)
committerBenjamin Peterson <benjamin@python.org>2010-08-17 01:10:45 (GMT)
commit5d6026a202ee91a6f9de6fae65af7773333ad321 (patch)
tree15ec37c629eed8e9424c54f6071e5097572b2945
parent80f724fda449f4a9ddc309f0283bb21648e4ea1a (diff)
downloadcpython-5d6026a202ee91a6f9de6fae65af7773333ad321.zip
cpython-5d6026a202ee91a6f9de6fae65af7773333ad321.tar.gz
cpython-5d6026a202ee91a6f9de6fae65af7773333ad321.tar.bz2
Merged revisions 84125 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r84125 | benjamin.peterson | 2010-08-16 20:07:53 -0500 (Mon, 16 Aug 2010) | 1 line use assertTrue/assertFalse ........
-rw-r--r--Lib/test/test_abc.py36
1 files changed, 18 insertions, 18 deletions
diff --git a/Lib/test/test_abc.py b/Lib/test/test_abc.py
index 31f1986..b5af46b 100644
--- a/Lib/test/test_abc.py
+++ b/Lib/test/test_abc.py
@@ -15,16 +15,16 @@ class TestABC(unittest.TestCase):
def test_abstractmethod_basics(self):
@abc.abstractmethod
def foo(self): pass
- self.assertEqual(foo.__isabstractmethod__, True)
+ self.assertTrue(foo.__isabstractmethod__)
def bar(self): pass
- self.assertEqual(hasattr(bar, "__isabstractmethod__"), False)
+ self.assertFalse(hasattr(bar, "__isabstractmethod__"))
def test_abstractproperty_basics(self):
@abc.abstractproperty
def foo(self): pass
- self.assertEqual(foo.__isabstractmethod__, True)
+ self.assertTrue(foo.__isabstractmethod__)
def bar(self): pass
- self.assertEqual(hasattr(bar, "__isabstractmethod__"), False)
+ self.assertFalse(hasattr(bar, "__isabstractmethod__"))
class C:
__metaclass__ = abc.ABCMeta
@@ -87,20 +87,20 @@ class TestABC(unittest.TestCase):
class B(object):
pass
b = B()
- self.assertEqual(issubclass(B, A), False)
- self.assertEqual(issubclass(B, (A,)), False)
+ self.assertFalse(issubclass(B, A))
+ self.assertFalse(issubclass(B, (A,)))
self.assertNotIsInstance(b, A)
self.assertNotIsInstance(b, (A,))
A.register(B)
- self.assertEqual(issubclass(B, A), True)
- self.assertEqual(issubclass(B, (A,)), True)
+ self.assertTrue(issubclass(B, A))
+ self.assertTrue(issubclass(B, (A,)))
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.assertTrue(issubclass(C, A))
+ self.assertTrue(issubclass(C, (A,)))
self.assertIsInstance(c, A)
self.assertIsInstance(c, (A,))
@@ -110,11 +110,11 @@ class TestABC(unittest.TestCase):
class B(object):
pass
b = B()
- self.assertEqual(isinstance(b, A), False)
- self.assertEqual(isinstance(b, (A,)), False)
+ self.assertFalse(isinstance(b, A))
+ self.assertFalse(isinstance(b, (A,)))
A.register(B)
- self.assertEqual(isinstance(b, A), True)
- self.assertEqual(isinstance(b, (A,)), True)
+ self.assertTrue(isinstance(b, A))
+ self.assertTrue(isinstance(b, (A,)))
def test_registration_builtins(self):
class A:
@@ -122,15 +122,15 @@ class TestABC(unittest.TestCase):
A.register(int)
self.assertIsInstance(42, A)
self.assertIsInstance(42, (A,))
- self.assertEqual(issubclass(int, A), True)
- self.assertEqual(issubclass(int, (A,)), True)
+ self.assertTrue(issubclass(int, A))
+ self.assertTrue(issubclass(int, (A,)))
class B(A):
pass
B.register(basestring)
self.assertIsInstance("", A)
self.assertIsInstance("", (A,))
- self.assertEqual(issubclass(str, A), True)
- self.assertEqual(issubclass(str, (A,)), True)
+ self.assertTrue(issubclass(str, A))
+ self.assertTrue(issubclass(str, (A,)))
def test_registration_edge_cases(self):
class A: