summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_reprlib.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_reprlib.py b/Lib/test/test_reprlib.py
index e7216d4..502287b 100644
--- a/Lib/test/test_reprlib.py
+++ b/Lib/test/test_reprlib.py
@@ -765,5 +765,14 @@ class TestRecursiveRepr(unittest.TestCase):
for name in assigned:
self.assertIs(getattr(wrapper, name), getattr(wrapped, name))
+ def test__wrapped__(self):
+ class X:
+ def __repr__(self):
+ return 'X()'
+ f = __repr__ # save reference to check it later
+ __repr__ = recursive_repr()(__repr__)
+
+ self.assertIs(X.f, X.__repr__.__wrapped__)
+
if __name__ == "__main__":
unittest.main()