mirror of
https://github.com/python/cpython.git
synced 2025-07-29 06:05:00 +00:00
Reverting the Revision: 77368. I committed Flox's big patch for tests by
mistake. ( It may come in for sure tough)
This commit is contained in:
parent
3ddc435af6
commit
ce8e33a095
107 changed files with 436 additions and 794 deletions
|
@ -192,12 +192,11 @@ class OperatorTestCase(unittest.TestCase):
|
|||
class C:
|
||||
pass
|
||||
def check(self, o, v):
|
||||
with test_support.check_warnings():
|
||||
self.assertTrue(operator.isCallable(o) == callable(o) == v)
|
||||
check(self, 4, False)
|
||||
check(self, operator.isCallable, True)
|
||||
check(self, C, True)
|
||||
check(self, C(), False)
|
||||
self.assertTrue(operator.isCallable(o) == callable(o) == v)
|
||||
check(self, 4, 0)
|
||||
check(self, operator.isCallable, 1)
|
||||
check(self, C, 1)
|
||||
check(self, C(), 0)
|
||||
|
||||
def test_isMappingType(self):
|
||||
self.assertRaises(TypeError, operator.isMappingType)
|
||||
|
@ -307,10 +306,8 @@ class OperatorTestCase(unittest.TestCase):
|
|||
self.assertRaises(TypeError, operator.contains, None, None)
|
||||
self.assertTrue(operator.contains(range(4), 2))
|
||||
self.assertFalse(operator.contains(range(4), 5))
|
||||
# Silence Py3k warning
|
||||
with test_support.check_warnings():
|
||||
self.assertTrue(operator.sequenceIncludes(range(4), 2))
|
||||
self.assertFalse(operator.sequenceIncludes(range(4), 5))
|
||||
self.assertTrue(operator.sequenceIncludes(range(4), 2))
|
||||
self.assertFalse(operator.sequenceIncludes(range(4), 5))
|
||||
|
||||
def test_setitem(self):
|
||||
a = range(3)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue