diff options
author | 2020-02-23 20:53:45 +0100 | |
---|---|---|
committer | 2020-02-23 21:00:48 +0100 | |
commit | ea64d7cc6defa759fc1c7f1631a7ae9b8073cc29 (patch) | |
tree | b531e49532de432978f58588faf301310bd10bcf /tests/base.py | |
parent | Remove lingering pytest test_time.py file (diff) |
Use unittest's AsyncMock instead of our AsyncMock
Python 3.8 introduced an `unittest.mock.AsyncMock` class that can be used to mock coroutines and other types of asynchronous operations like async iterators and async context managers. As we were using our custom, but limited, AsyncMock, I have replaced our mock with unittest's AsyncMock.
Since Python 3.8 also introduces a different way of automatically detecting which attributes should be mocked with an AsyncMock, I've changed our CustomMockMixin to use this new method as well. Together with a couple other small changes, this means that our Custom Mocks now use a lazy method of detecting coroutine attributes, which significantly speeds up the test suite.
Diffstat (limited to 'tests/base.py')
0 files changed, 0 insertions, 0 deletions