honeybadger-io / honeybadger-python

Send Python and Django errors to Honeybadger.
https://www.honeybadger.io/
MIT License
15 stars 25 forks source link

async def test_should_not_notify_exception() generates RuntimeWarning #148

Closed dotysan closed 1 year ago

dotysan commented 1 year ago

So I'm horsing around with replacing python setup.py test with tox run and this RuntimeWarning jumped out at me.

test_should_not_notify_exception (honeybadger.tests.contrib.test_asgi.ASGIPluginTestCase) ... /home/curtis/src/honeybadger-python/.tox/py39/lib/python3.9/site-packages/mock/mock.py:1440: RuntimeWarning: coroutine 'TestClient.get' was never awaited
  return await func(*newargs, **newkeywargs)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
ok

https://github.com/honeybadger-io/honeybadger-python/blob/65215a97318bda878c8b23bbf64e5ff6cf3fd854/honeybadger/tests/contrib/test_asgi.py#L41-L45

It's actually there in the CI test output too. Appears harmless, but I'm not sure how to make it go away.

subzero10 commented 1 year ago

I think we are missing an await in line 44.

dotysan commented 1 year ago

Thx @subzero10! I thought the same, but still got an error. I see you found the root cause on #151. Looks good here!