dronefly-garden / dronefly

Red Discord Bot V3 cogs for naturalists.
Other
16 stars 3 forks source link

Fix all skipped tests (api change from requests to aiohttp) #65

Closed synrg closed 4 years ago

synrg commented 4 years ago

In the switch from requests to aiohttp, all tests that mocked requests broke. This is far from ideal. We need a replacement that works with coroutines to enable them again.

synrg commented 4 years ago

Not really a bug, since the old tests are for code that no longer exists in its original form. Absence of tests for new code is not a bug, but a TODO.

synrg commented 4 years ago

It looks like AsyncMock from unittest.mock is the way forward. See the question here https://github.com/pytest-dev/pytest-asyncio/issues/108 and their official recommendation, which is to use AsyncMock. See also the API doc at https://docs.python.org/3/library/unittest.mock.html#unittest.mock.AsyncMock

synrg commented 4 years ago

Fixed in 672cea37132e3a96aace39db323fc2eb3b654dd3