summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/test/test_scope.py15
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 """