Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/test_aioresponses.py::AIOResponsesTestCase::test_callback_coroutine fails with python3.11 #215

Open
mgorny opened this issue Jun 12, 2022 · 0 comments

Comments

@mgorny
Copy link

mgorny commented Jun 12, 2022

When running the test suite under Python 3.11.0b3, I get the following failure:

____________________________________________ AIOResponsesTestCase.test_callback_coroutine _____________________________________________

self = <tests.test_aioresponses.AIOResponsesTestCase testMethod=test_callback_coroutine>
m = <aioresponses.core.aioresponses object at 0x7fdcc0556390>

    @aioresponses()
    def test_callback_coroutine(self, m):
        body = b'New body'
        event = asyncio.Event()

        async def callback(url, **kwargs):
            await event.wait()
            self.assertEqual(str(url), self.url)
            self.assertEqual(kwargs, {'allow_redirects': True})
            return CallbackResult(body=body)

        m.get(self.url, callback=callback)
        future = asyncio.ensure_future(self.request(self.url))
        self.run_async(asyncio.wait([future], timeout=0))
        assert not future.done()
        event.set()
        self.run_async(asyncio.wait([future], timeout=0))
>       assert future.done()
E       AssertionError: assert False
E        +  where False = <built-in method done of _asyncio.Task object at 0x7fdcbfc96080>()
E        +    where <built-in method done of _asyncio.Task object at 0x7fdcbfc96080> = <Task pending name='Task-25' coro=<AIOResponsesTestCase.request() running at /tmp/aioresponses/tests/test_aioresponses.py:49>>.done

tests/test_aioresponses.py:490: AssertionError

This is on Gentoo Linux. I can reproduce with git master @ 8242acc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant