diff options
author | Benjamin Peterson <benjamin@python.org> | 2011-05-25 00:31:01 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2011-05-25 00:31:01 (GMT) |
commit | b45c7087aa967843f2e11116fbb4a7f5a32a1c3f (patch) | |
tree | 4c24b9e6de41c98b16925ba8113083a4db654058 /Lib/test/test_descr.py | |
parent | be6210363e1bd275df5a31c394f39b934dad1b14 (diff) | |
download | cpython-b45c7087aa967843f2e11116fbb4a7f5a32a1c3f.zip cpython-b45c7087aa967843f2e11116fbb4a7f5a32a1c3f.tar.gz cpython-b45c7087aa967843f2e11116fbb4a7f5a32a1c3f.tar.bz2 |
excellent place for assertRaises
Diffstat (limited to 'Lib/test/test_descr.py')
-rw-r--r-- | Lib/test/test_descr.py | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index 31731d2..0fae2df 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -1631,12 +1631,7 @@ order (MRO) for bases """ for attr, obj in env.items(): setattr(X, attr, obj) setattr(X, name, ErrDescr()) - try: - runner(X()) - except MyException: - pass - else: - self.fail("{0!r} didn't raise".format(name)) + self.assertRaises(MyException, runner, X()) def test_specials(self): # Testing special operators... |