diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-07-02 22:56:16 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-07-02 22:56:16 (GMT) |
commit | 50a225285179e3ddb6729fef83826f294b660823 (patch) | |
tree | 1a9851aadb986a85ff91b8dcfa2f8c91a2517669 /Lib/test | |
parent | d3243d8db8ff028f0268dc95decbab98169f2c4e (diff) | |
download | cpython-50a225285179e3ddb6729fef83826f294b660823.zip cpython-50a225285179e3ddb6729fef83826f294b660823.tar.gz cpython-50a225285179e3ddb6729fef83826f294b660823.tar.bz2 |
condense with assertRaises
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_scope.py | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/Lib/test/test_scope.py b/Lib/test/test_scope.py index b68e8f5..cf30ff9 100644 --- a/Lib/test/test_scope.py +++ b/Lib/test/test_scope.py @@ -289,19 +289,8 @@ def noproblem3(): inner() y = 1 - try: - errorInOuter() - except UnboundLocalError: - pass - else: - self.fail() - - try: - errorInInner() - except NameError: - pass - else: - self.fail() + self.assertRaises(UnboundLocalError, errorInOuter) + self.assertRaises(NameError, errorInInner) # test for bug #1501934: incorrect LOAD/STORE_GLOBAL generation exec """ |