move test to a better location
This commit is contained in:
parent
f9aefce634
commit
9b6760225a
|
@ -564,27 +564,6 @@ class ExceptionTests(unittest.TestCase):
|
|||
pass
|
||||
self.assertEquals(e, (None, None, None))
|
||||
|
||||
def test_3118(self):
|
||||
def gen():
|
||||
try:
|
||||
yield 1
|
||||
finally:
|
||||
pass
|
||||
|
||||
def f():
|
||||
g = gen()
|
||||
next(g)
|
||||
try:
|
||||
try:
|
||||
raise ValueError
|
||||
except:
|
||||
del g
|
||||
raise KeyError
|
||||
except Exception as e:
|
||||
self.assert_(isinstance(e.__context__, ValueError))
|
||||
|
||||
f()
|
||||
|
||||
|
||||
def test_badisinstance(self):
|
||||
# Bug #2542: if issubclass(e, MyException) raises an exception,
|
||||
|
|
|
@ -302,6 +302,28 @@ class TestContext(unittest.TestCase):
|
|||
except NameError as e:
|
||||
self.failUnless(e.__context__.__context__ is None)
|
||||
|
||||
def test_3118(self):
|
||||
# deleting the generator caused the __context__ to be cleared
|
||||
def gen():
|
||||
try:
|
||||
yield 1
|
||||
finally:
|
||||
pass
|
||||
|
||||
def f():
|
||||
g = gen()
|
||||
next(g)
|
||||
try:
|
||||
try:
|
||||
raise ValueError
|
||||
except:
|
||||
del g
|
||||
raise KeyError
|
||||
except Exception as e:
|
||||
self.assert_(isinstance(e.__context__, ValueError))
|
||||
|
||||
f()
|
||||
|
||||
|
||||
class TestRemovedFunctionality(unittest.TestCase):
|
||||
def test_tuples(self):
|
||||
|
|
Loading…
Reference in New Issue