summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2009-03-03 10:52:49 (GMT)
committerRaymond Hettinger <python@rcn.com>2009-03-03 10:52:49 (GMT)
commitb0d56afc84f4a7dacd8296e9203b051f019e2c3a (patch)
tree55898cd03e893b6e7694c8fef52731c3d2f36fb8 /Lib
parentce57cdbea80c274646b0cbde50f05a9cb884bcf6 (diff)
downloadcpython-b0d56afc84f4a7dacd8296e9203b051f019e2c3a.zip
cpython-b0d56afc84f4a7dacd8296e9203b051f019e2c3a.tar.gz
cpython-b0d56afc84f4a7dacd8296e9203b051f019e2c3a.tar.bz2
Give dict views a helpful __repr__.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_dict.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_dict.py b/Lib/test/test_dict.py
index bfc31af..308143d 100644
--- a/Lib/test/test_dict.py
+++ b/Lib/test/test_dict.py
@@ -36,16 +36,16 @@ class DictTest(unittest.TestCase):
k = d.keys()
self.assert_('a' in d)
self.assert_('b' in d)
-
self.assertRaises(TypeError, d.keys, None)
+ self.assertEqual(repr(dict(a=1).keys()), "dict_keys(['a'])")
def test_values(self):
d = {}
self.assertEqual(set(d.values()), set())
d = {1:2}
self.assertEqual(set(d.values()), {2})
-
self.assertRaises(TypeError, d.values, None)
+ self.assertEqual(repr(dict(a=1).values()), "dict_values([1])")
def test_items(self):
d = {}
@@ -53,8 +53,8 @@ class DictTest(unittest.TestCase):
d = {1:2}
self.assertEqual(set(d.items()), {(1, 2)})
-
self.assertRaises(TypeError, d.items, None)
+ self.assertEqual(repr(dict(a=1).items()), "dict_items([('a', 1)])")
def test_contains(self):
d = {}