summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-07-02 22:56:16 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-07-02 22:56:16 (GMT)
commit50a225285179e3ddb6729fef83826f294b660823 (patch)
tree1a9851aadb986a85ff91b8dcfa2f8c91a2517669
parentd3243d8db8ff028f0268dc95decbab98169f2c4e (diff)
downloadcpython-50a225285179e3ddb6729fef83826f294b660823.zip
cpython-50a225285179e3ddb6729fef83826f294b660823.tar.gz
cpython-50a225285179e3ddb6729fef83826f294b660823.tar.bz2
condense with assertRaises
-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 """