def test_asynchornize_with_exception(self):
class TestClass:
@classmethod
def _get_db(cls):
db = Mock()
db._framework = asyncio_framework
return db
@metaprogramming.asynchronize
def sync(self):
raise Exception
testobj = TestClass()
with self.assertRaises(Exception):
yield from testobj.sync()
评论列表
文章目录