Forward port r70470 and r70473 for OrderedDict to use a doubly linked list.

This commit is contained in:
Raymond Hettinger 2009-03-19 20:30:56 +00:00
parent 6cf17aacbf
commit dc879f033c
3 changed files with 44 additions and 17 deletions

View file

@ -770,12 +770,19 @@ class TestOrderedDict(unittest.TestCase):
class GeneralMappingTests(mapping_tests.BasicTestMappingProtocol):
type2test = OrderedDict
def test_popitem(self):
d = self._empty_mapping()
self.assertRaises(KeyError, d.popitem)
class MyOrderedDict(OrderedDict):
pass
class SubclassMappingTests(mapping_tests.BasicTestMappingProtocol):
type2test = MyOrderedDict
def test_popitem(self):
d = self._empty_mapping()
self.assertRaises(KeyError, d.popitem)
import doctest, collections