mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Improve test coverage. Hope the test_file changes work the same on windows.
This commit is contained in:
parent
307021f40b
commit
fcf4435ae0
5 changed files with 75 additions and 0 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue