asynctest icon indicating copy to clipboard operation
asynctest copied to clipboard

Advance fails with uvloop

Open wa-dev opened this issue 5 years ago • 0 comments

I am using asynctest with python 3.7.3 and uvloop.

Have have several test that look similar to the following code.

    async def test_autoupdate(self):
        "Test that _update_state gets executes and ready works"

        queue = Q(update_interval=0.01)
        queue.start()
        await queue.ready()

        last_update = queue.last_update

        await self.advance(0.5)

        second_update = queue.last_update
        self.assertNotEqual(last_update, second_update)

In all of my test that use the advance method, I get the following exception

    def _next_scheduled(self):
        try:
>           return self.loop._scheduled[0]._when
E           AttributeError: 'Loop' object has no attribute '_scheduled'

.../lib/python3.7/site-packages/asynctest/case.py:482: AttributeError

All of my other async test work great. I just have issues with the ones that use advance.

wa-dev avatar Jul 19 '19 18:07 wa-dev