Re: Channels: Test case fails on async.sleep(X>0)

2018-11-13 Thread Andrew Godwin
Couple of points: - Did you install pytest-django? That should help the settings thing. - There's a default 1-second timeout on get_response; pass timeout=4 to it and you should see that error go away. We have a default timeout because otherwise we can't tell if an async app has died/crashed and

Channels: Test case fails on async.sleep(X>0)

2018-11-12 Thread Zhiyu (Drew) Li
Hi there, I was trying to write a test for a consumer. It is just a very simply AsyncHttpConsumer subclass that awaits on asyncio.sleep(3) and returns a "OK" in plain text. The test case is: @pytest.mark.asyncio async def test_my_consumer(): communicator = HttpCommunicator(BasicHttpConsumer,