diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2005-11-27 20:37:43 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2005-11-27 20:37:43 (GMT) |
commit | fcf4435ae02c3962a8ad71a9539877060c694468 (patch) | |
tree | 66b05ecac0df3d4105c15ee62f6ea8b520e87312 /Lib/test/test_set.py | |
parent | 307021f40b227d2bf114b536c37cc41e03fc2aff (diff) | |
download | cpython-fcf4435ae02c3962a8ad71a9539877060c694468.zip cpython-fcf4435ae02c3962a8ad71a9539877060c694468.tar.gz cpython-fcf4435ae02c3962a8ad71a9539877060c694468.tar.bz2 |
Improve test coverage. Hope the test_file changes work the same on windows.
Diffstat (limited to 'Lib/test/test_set.py')
-rw-r--r-- | Lib/test/test_set.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py index 77df31b..e26065c 100644 --- a/Lib/test/test_set.py +++ b/Lib/test/test_set.py @@ -606,6 +606,8 @@ class TestBasicOps(unittest.TestCase): def test_iteration(self): for v in self.set: self.assert_(v in self.values) + setiter = iter(self.set) + self.assertEqual(setiter._length_cue(), len(self.set)) def test_pickling(self): p = pickle.dumps(self.set) @@ -693,6 +695,16 @@ class TestExceptionPropagation(unittest.TestCase): set('abc') set(gooditer()) + def test_changingSizeWhileIterating(self): + s = set([1,2,3]) + try: + for i in s: + s.update([4]) + except RuntimeError: + pass + else: + self.fail("no exception when changing size during iteration") + #============================================================================== class TestSetOfSets(unittest.TestCase): |