mirror of
https://github.com/python/cpython.git
synced 2025-10-17 12:18:23 +00:00
stylistic nits:
- wrap some long lines - shorten others - fix indentation
This commit is contained in:
parent
d9cf8e7e7c
commit
f425b1ec42
1 changed files with 8 additions and 6 deletions
|
@ -168,7 +168,8 @@ class ReferencesTestCase(TestBase):
|
||||||
p[:] = [2, 3]
|
p[:] = [2, 3]
|
||||||
self.assertEqual(len(L), 2)
|
self.assertEqual(len(L), 2)
|
||||||
self.assertEqual(len(p), 2)
|
self.assertEqual(len(p), 2)
|
||||||
self.failUnless(3 in p, "proxy didn't support __contains__() properly")
|
self.failUnless(3 in p,
|
||||||
|
"proxy didn't support __contains__() properly")
|
||||||
p[1] = 5
|
p[1] = 5
|
||||||
self.assertEqual(L[1], 5)
|
self.assertEqual(L[1], 5)
|
||||||
self.assertEqual(p[1], 5)
|
self.assertEqual(p[1], 5)
|
||||||
|
@ -398,7 +399,8 @@ class MappingTestCase(TestBase):
|
||||||
values = dict.values()
|
values = dict.values()
|
||||||
for v in dict.itervalues():
|
for v in dict.itervalues():
|
||||||
values.remove(v)
|
values.remove(v)
|
||||||
self.assert_(len(values) == 0, "itervalues() did not touch all values")
|
self.assert_(len(values) == 0,
|
||||||
|
"itervalues() did not touch all values")
|
||||||
|
|
||||||
def test_make_weak_keyed_dict_from_dict(self):
|
def test_make_weak_keyed_dict_from_dict(self):
|
||||||
o = Object(3)
|
o = Object(3)
|
||||||
|
@ -589,14 +591,14 @@ class MappingTestCase(TestBase):
|
||||||
from test_userdict import TestMappingProtocol
|
from test_userdict import TestMappingProtocol
|
||||||
|
|
||||||
class WeakValueDictionaryTestCase(TestMappingProtocol):
|
class WeakValueDictionaryTestCase(TestMappingProtocol):
|
||||||
"""Check that WeakValueDictionary class conforms to the mapping protocol"""
|
"""Check that WeakValueDictionary conforms to the mapping protocol"""
|
||||||
__ref = {"key1":Object(1), "key2":Object(2), "key3":Object(3)}
|
__ref = {"key1":Object(1), "key2":Object(2), "key3":Object(3)}
|
||||||
_tested_class = weakref.WeakValueDictionary
|
_tested_class = weakref.WeakValueDictionary
|
||||||
def _reference(self):
|
def _reference(self):
|
||||||
return self.__ref.copy()
|
return self.__ref.copy()
|
||||||
|
|
||||||
class WeakKeyDictionaryTestCase(TestMappingProtocol):
|
class WeakKeyDictionaryTestCase(TestMappingProtocol):
|
||||||
"""Check that WeakKeyDictionary class conforms to the mapping protocol"""
|
"""Check that WeakKeyDictionary conforms to the mapping protocol"""
|
||||||
__ref = {Object("key1"):1, Object("key2"):2, Object("key3"):3}
|
__ref = {Object("key1"):1, Object("key2"):2, Object("key3"):3}
|
||||||
_tested_class = weakref.WeakKeyDictionary
|
_tested_class = weakref.WeakKeyDictionary
|
||||||
def _reference(self):
|
def _reference(self):
|
||||||
|
@ -607,8 +609,8 @@ def test_main():
|
||||||
ReferencesTestCase,
|
ReferencesTestCase,
|
||||||
MappingTestCase,
|
MappingTestCase,
|
||||||
WeakValueDictionaryTestCase,
|
WeakValueDictionaryTestCase,
|
||||||
WeakKeyDictionaryTestCase
|
WeakKeyDictionaryTestCase,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue