diff options
| author | Senthil Kumaran <orsenthil@gmail.com> | 2010-01-08 18:41:40 (GMT) |
|---|---|---|
| committer | Senthil Kumaran <orsenthil@gmail.com> | 2010-01-08 18:41:40 (GMT) |
| commit | 3ddc435af6873c6304058d7bcbcb19ee4fba7781 (patch) | |
| tree | c7a03cf0a8b856bae2ebebba55b09f775845c7ca /Lib/test/test_operator.py | |
| parent | 3194d1454cbc11ec477d83fff3fc749972107d29 (diff) | |
| download | cpython-3ddc435af6873c6304058d7bcbcb19ee4fba7781.zip cpython-3ddc435af6873c6304058d7bcbcb19ee4fba7781.tar.gz cpython-3ddc435af6873c6304058d7bcbcb19ee4fba7781.tar.bz2 | |
Fixing - Issue7026 - RuntimeError: dictionary changed size during iteration. Patch by flox
Diffstat (limited to 'Lib/test/test_operator.py')
| -rw-r--r-- | Lib/test/test_operator.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/Lib/test/test_operator.py b/Lib/test/test_operator.py index 2758856..70b9fd9 100644 --- a/Lib/test/test_operator.py +++ b/Lib/test/test_operator.py @@ -192,11 +192,12 @@ class OperatorTestCase(unittest.TestCase): class C: pass def check(self, o, v): - 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) + 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) def test_isMappingType(self): self.assertRaises(TypeError, operator.isMappingType) @@ -306,8 +307,10 @@ 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)) - self.assertTrue(operator.sequenceIncludes(range(4), 2)) - self.assertFalse(operator.sequenceIncludes(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)) def test_setitem(self): a = range(3) |
