summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_dict.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2004-09-30 15:07:29 (GMT)
committerRaymond Hettinger <python@rcn.com>2004-09-30 15:07:29 (GMT)
commit49c522be80c075c7cb4ccabb897cf9043e938181 (patch)
treeeb11f01e188c227e4640094de00bb2c39b953d12 /Lib/test/test_dict.py
parent59b23e8b80f170fafdfdf76aa7a65506f558f0c8 (diff)
downloadcpython-49c522be80c075c7cb4ccabb897cf9043e938181.zip
cpython-49c522be80c075c7cb4ccabb897cf9043e938181.tar.gz
cpython-49c522be80c075c7cb4ccabb897cf9043e938181.tar.bz2
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.
Diffstat (limited to 'Lib/test/test_dict.py')
-rw-r--r--Lib/test/test_dict.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_dict.py b/Lib/test/test_dict.py
index e05e734..e13829c 100644
--- a/Lib/test/test_dict.py
+++ b/Lib/test/test_dict.py
@@ -395,9 +395,22 @@ class DictTest(unittest.TestCase):
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__":