Using Pytest and asyncio I am trying to execute an async test:
async def count(self):
return "2"
async def test_foo(self):
x = []
x.append(await asyncio.gather(self.count(), self.count(), self.count()))
print(x)
If this code is launched without using pytest, it returns this:
[['2', '2', '2']]
With Pytest it does not seem to be executing anything inside the funcion. It returns this warning:
RuntimeWarning: coroutine 'TestClass.test_foo' was never awaited
method()
Any idea?