summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_descr.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-04-24 15:09:20 (GMT)
committerBenjamin Peterson <benjamin@python.org>2012-04-24 15:09:20 (GMT)
commit42f58818d6100c2bef07245e360e7d8ca660058f (patch)
tree899889f3420a069e1dadc2a9dc7d9480b4654b5c /Lib/test/test_descr.py
parent7ce67e45f89d5d4955c4f72a64631aa9b56b8471 (diff)
parent7b1668735ace947474bb94f812c03b39bd963a77 (diff)
downloadcpython-42f58818d6100c2bef07245e360e7d8ca660058f.zip
cpython-42f58818d6100c2bef07245e360e7d8ca660058f.tar.gz
cpython-42f58818d6100c2bef07245e360e7d8ca660058f.tar.bz2
merge 3.2 (#14658)
Diffstat (limited to 'Lib/test/test_descr.py')
-rw-r--r--Lib/test/test_descr.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index c0c7414..b9b1c72 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -4438,7 +4438,15 @@ order (MRO) for bases """
pass
Foo.__repr__ = Foo.__str__
foo = Foo()
- str(foo)
+ self.assertRaises(RuntimeError, str, foo)
+ self.assertRaises(RuntimeError, repr, foo)
+
+ def test_mixing_slot_wrappers(self):
+ class X(dict):
+ __setattr__ = dict.__setitem__
+ x = X()
+ x.y = 42
+ self.assertEqual(x["y"], 42)
def test_slot_shadows_class_variable(self):
with self.assertRaises(ValueError) as cm: