mirror of https://github.com/python/cpython.git
Expand scope to include general mapping protocol tests.
Many of these tests are redundant, but this will ensure that the mapping protocols all stay in sync. Also, added a test for dictionary subclasses.
This commit is contained in:
parent
59b23e8b80
commit
49c522be80
|
@ -395,9 +395,22 @@ def __eq__(self, other):
|
||||||
else:
|
else:
|
||||||
self.fail("< didn't raise Exc")
|
self.fail("< didn't raise Exc")
|
||||||
|
|
||||||
|
import mapping_tests
|
||||||
|
|
||||||
|
class GeneralMappingTests(mapping_tests.BasicTestMappingProtocol):
|
||||||
|
type2test = dict
|
||||||
|
|
||||||
|
class Dict(dict):
|
||||||
|
pass
|
||||||
|
|
||||||
|
class SubclassMappingTests(mapping_tests.BasicTestMappingProtocol):
|
||||||
|
type2test = Dict
|
||||||
|
|
||||||
def test_main():
|
def test_main():
|
||||||
test_support.run_unittest(
|
test_support.run_unittest(
|
||||||
DictTest,
|
DictTest,
|
||||||
|
GeneralMappingTests,
|
||||||
|
SubclassMappingTests,
|
||||||
)
|
)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Reference in New Issue