diff options
| author | Benjamin Peterson <benjamin@python.org> | 2011-07-15 19:10:35 (GMT) |
|---|---|---|
| committer | Benjamin Peterson <benjamin@python.org> | 2011-07-15 19:10:35 (GMT) |
| commit | e92cd0ce987d11acf2b93d43171f61c297e935ba (patch) | |
| tree | 14c0986adc09d30245c97157fb1eac79b0f68102 /Lib/test/test_raise.py | |
| parent | af5bacf9bb9b9729fac3da50111441b1f0efdd44 (diff) | |
| parent | 5afa03a72ee6d27e742dc0ebc06a0630e1b37fe9 (diff) | |
| download | cpython-e92cd0ce987d11acf2b93d43171f61c297e935ba.zip cpython-e92cd0ce987d11acf2b93d43171f61c297e935ba.tar.gz cpython-e92cd0ce987d11acf2b93d43171f61c297e935ba.tar.bz2 | |
merge 3.2 (#11627)
Diffstat (limited to 'Lib/test/test_raise.py')
| -rw-r--r-- | Lib/test/test_raise.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_raise.py b/Lib/test/test_raise.py index d120dc1..e02c1af 100644 --- a/Lib/test/test_raise.py +++ b/Lib/test/test_raise.py @@ -121,6 +121,15 @@ class TestRaise(unittest.TestCase): else: self.fail("No exception raised") + def test_new_returns_invalid_instance(self): + # See issue #11627. + class MyException(Exception): + def __new__(cls, *args): + return object() + + with self.assertRaises(TypeError): + raise MyException + class TestCause(unittest.TestCase): def test_invalid_cause(self): |
