summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2010-12-18 14:59:43 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2010-12-18 14:59:43 (GMT)
commitac53ab64a648f512f4a232567f096b8fb14287bf (patch)
tree33dbd8d10706568779ea848a7f4e4972fecb95d3 /Lib
parent197c9c945e127199d0b0966d33abe00f512d0e8b (diff)
downloadcpython-ac53ab64a648f512f4a232567f096b8fb14287bf.zip
cpython-ac53ab64a648f512f4a232567f096b8fb14287bf.tar.gz
cpython-ac53ab64a648f512f4a232567f096b8fb14287bf.tar.bz2
#5587: add a repr to dict_proxy objects. Patch by David Stanek and Daniel Urban.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_descr.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index 233b7cb..115d1e8 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -4268,6 +4268,11 @@ class DictProxyTests(unittest.TestCase):
pass
self.assertEqual(type(C.__dict__), type(B.__dict__))
+ def test_repr(self):
+ # Testing dict_proxy.__repr__
+ dict_ = {k: v for k, v in self.C.__dict__.items()}
+ self.assertEqual(repr(self.C.__dict__), 'dict_proxy({!r})'.format(dict_))
+
class PTypesLongInitTest(unittest.TestCase):
# This is in its own TestCase so that it can be run before any other tests.