diff options
author | 2020-02-23 13:05:10 +0100 | |
---|---|---|
committer | 2020-02-23 21:00:48 +0100 | |
commit | 135d6daa4804574935cd788c5baec656765f484b (patch) | |
tree | c5e6b73dcce43f893b7bc4955d1fecc42933ba20 /tests/helpers.py | |
parent | Use mixin-composition not inheritance for LoggingTestCase (diff) |
Use IsolatedAsyncioTestCase instead of async_test
Since we upgraded to Python 3.8, we can now use the new IsolatedAsyncioTestCase test class to use coroutine-based test methods instead of our own, custom async_test decorator. I have changed the base class for all of our test classes that use coroutine-based test methods and removed the now obsolete decorator from our helpers.
Diffstat (limited to 'tests/helpers.py')
-rw-r--r-- | tests/helpers.py | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/tests/helpers.py b/tests/helpers.py index 5df796c23..01752a791 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -1,8 +1,6 @@ from __future__ import annotations -import asyncio import collections -import functools import inspect import itertools import logging @@ -25,21 +23,6 @@ for logger in logging.Logger.manager.loggerDict.values(): logger.setLevel(logging.CRITICAL) -def async_test(wrapped): - """ - Run a test case via asyncio. - Example: - >>> @async_test - ... async def lemon_wins(): - ... assert True - """ - - @functools.wraps(wrapped) - def wrapper(*args, **kwargs): - return asyncio.run(wrapped(*args, **kwargs)) - return wrapper - - class HashableMixin(discord.mixins.EqualityComparable): """ Mixin that provides similar hashing and equality functionality as discord.py's `Hashable` mixin. |