From 49c522be80c075c7cb4ccabb897cf9043e938181 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Thu, 30 Sep 2004 15:07:29 +0000 Subject: [PATCH] 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. --- Lib/test/test_dict.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Lib/test/test_dict.py b/Lib/test/test_dict.py index e05e734ac665..e13829caec9d 100644 --- a/Lib/test/test_dict.py +++ b/Lib/test/test_dict.py @@ -395,9 +395,22 @@ def __eq__(self, other): else: 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(): test_support.run_unittest( DictTest, + GeneralMappingTests, + SubclassMappingTests, ) if __name__ == "__main__":