Fix test_operator.
This commit is contained in:
parent
c31cbbdb73
commit
d9a4e29db9
|
@ -192,8 +192,8 @@ class OperatorTestCase(unittest.TestCase):
|
||||||
class C:
|
class C:
|
||||||
pass
|
pass
|
||||||
def check(self, o, v):
|
def check(self, o, v):
|
||||||
with test_support._check_py3k_warnings():
|
|
||||||
self.assertEqual(operator.isCallable(o), v)
|
self.assertEqual(operator.isCallable(o), v)
|
||||||
|
with test_support._check_py3k_warnings():
|
||||||
self.assertEqual(callable(o), v)
|
self.assertEqual(callable(o), v)
|
||||||
check(self, 4, 0)
|
check(self, 4, 0)
|
||||||
check(self, operator.isCallable, 1)
|
check(self, operator.isCallable, 1)
|
||||||
|
@ -308,7 +308,6 @@ class OperatorTestCase(unittest.TestCase):
|
||||||
self.assertRaises(TypeError, operator.contains, None, None)
|
self.assertRaises(TypeError, operator.contains, None, None)
|
||||||
self.assertTrue(operator.contains(range(4), 2))
|
self.assertTrue(operator.contains(range(4), 2))
|
||||||
self.assertFalse(operator.contains(range(4), 5))
|
self.assertFalse(operator.contains(range(4), 5))
|
||||||
with test_support._check_py3k_warnings():
|
|
||||||
self.assertTrue(operator.sequenceIncludes(range(4), 2))
|
self.assertTrue(operator.sequenceIncludes(range(4), 2))
|
||||||
self.assertFalse(operator.sequenceIncludes(range(4), 5))
|
self.assertFalse(operator.sequenceIncludes(range(4), 5))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue