condense with assertRaises

This commit is contained in:
Benjamin Peterson 2009-07-02 22:56:16 +00:00
parent d3243d8db8
commit 50a2252851
1 changed files with 2 additions and 13 deletions

View File

@ -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 """