summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_bool.py
diff options
context:
space:
mode:
authorSenthil Kumaran <orsenthil@gmail.com>2010-01-08 19:04:16 (GMT)
committerSenthil Kumaran <orsenthil@gmail.com>2010-01-08 19:04:16 (GMT)
commitce8e33a095030e7af94f58f9da196b240bdf0476 (patch)
treeb0ba50cbb6e85c6be6f6e6a870e4232be50a0f9c /Lib/test/test_bool.py
parent3ddc435af6873c6304058d7bcbcb19ee4fba7781 (diff)
downloadcpython-ce8e33a095030e7af94f58f9da196b240bdf0476.zip
cpython-ce8e33a095030e7af94f58f9da196b240bdf0476.tar.gz
cpython-ce8e33a095030e7af94f58f9da196b240bdf0476.tar.bz2
Reverting the Revision: 77368. I committed Flox's big patch for tests by
mistake. ( It may come in for sure tough)
Diffstat (limited to 'Lib/test/test_bool.py')
-rw-r--r--Lib/test/test_bool.py26
1 files changed, 10 insertions, 16 deletions
diff --git a/Lib/test/test_bool.py b/Lib/test/test_bool.py
index 805d758..2a9ef5d 100644
--- a/Lib/test/test_bool.py
+++ b/Lib/test/test_bool.py
@@ -91,10 +91,10 @@ class BoolTest(unittest.TestCase):
self.assertEqual(False*1, 0)
self.assertIsNot(False*1, False)
- self.assertEqual(True//1, 1)
- self.assertIsNot(True//1, True)
- self.assertEqual(False//1, 0)
- self.assertIsNot(False//1, False)
+ self.assertEqual(True/1, 1)
+ self.assertIsNot(True/1, True)
+ self.assertEqual(False/1, 0)
+ self.assertIsNot(False/1, False)
for b in False, True:
for i in 0, 1, 2:
@@ -168,8 +168,8 @@ class BoolTest(unittest.TestCase):
self.assertIs(hasattr([], "wobble"), False)
def test_callable(self):
- self.assertTrue(hasattr(len, '__call__'), True)
- self.assertFalse(hasattr(1, '__call__'), False)
+ self.assertIs(callable(len), True)
+ self.assertIs(callable(1), False)
def test_isinstance(self):
self.assertIs(isinstance(True, bool), True)
@@ -184,12 +184,8 @@ class BoolTest(unittest.TestCase):
self.assertIs(issubclass(int, bool), False)
def test_haskey(self):
- self.assertIs(1 in {}, False)
- self.assertIs(1 in {1:1}, True)
- # Silence Py3k warning
- with test_support.check_warnings():
- self.assertIs({}.has_key(1), False)
- self.assertIs({1:1}.has_key(1), True)
+ self.assertIs({}.has_key(1), False)
+ self.assertIs({1:1}.has_key(1), True)
def test_string(self):
self.assertIs("xyz".endswith("z"), True)
@@ -261,10 +257,8 @@ class BoolTest(unittest.TestCase):
import operator
self.assertIs(operator.truth(0), False)
self.assertIs(operator.truth(1), True)
- # Silence Py3k warning
- with test_support.check_warnings():
- self.assertIs(operator.isCallable(0), False)
- self.assertIs(operator.isCallable(len), True)
+ self.assertIs(operator.isCallable(0), False)
+ self.assertIs(operator.isCallable(len), True)
self.assertIs(operator.isNumberType(None), False)
self.assertIs(operator.isNumberType(0), True)
self.assertIs(operator.not_(1), False)