我有测试用例:
class HttpbinSuit(IsolatedAsyncioTestCase):
async def asyncSetUp(self):
self.client = Client("https://httpbin.org/")
#...
然后主要我想运行它并查看结果,或者生成 allure-report.
suites = {
"playground": HttpbinSuit,
}
suite = unittest.TestLoader().loadTestsFromTestCase(suites["playground"])
if parallel:
concurrent_suite = testtools.ConcurrentStreamTestSuite(
lambda: ((case, None) for case in suite)
)
concurrent_suite.run(testtools.StreamResult())
else:
runner = unittest.TextTestRunner()
runner.run(suite)
在并行运行的情况下我没有看到任何结果,并且在顺序运行时失败并显示
coroutine was never awaited
。我该如何解决这个问题?