mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
asyncio: Future.set_exception(exc) should instantiate exc if it is a class.
This commit is contained in:
parent
91445fbeb0
commit
9572898282
2 changed files with 7 additions and 0 deletions
|
@ -79,6 +79,11 @@ class FutureTests(unittest.TestCase):
|
|||
self.assertRaises(asyncio.InvalidStateError, f.set_exception, None)
|
||||
self.assertFalse(f.cancel())
|
||||
|
||||
def test_exception_class(self):
|
||||
f = asyncio.Future(loop=self.loop)
|
||||
f.set_exception(RuntimeError)
|
||||
self.assertIsInstance(f.exception(), RuntimeError)
|
||||
|
||||
def test_yield_from_twice(self):
|
||||
f = asyncio.Future(loop=self.loop)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue