slackapi / python-slack-sdk

Slack Developer Kit for Python
https://tools.slack.dev/python-slack-sdk/
MIT License
3.86k stars 834 forks source link

Update async unit tests to use unittest.IsolatedAsyncioTestCase base classes #1052

Open srajiang opened 3 years ago

srajiang commented 3 years ago

Currently unit tests employ a helper async_test method defined in in order to run async tests.

As of v3.8, the unittest module supports a base class IsolatedAsyncioTestCase with a similar API to TestCase, but which also accepts coroutines as test functions. We can update unit test implementations to use this instead of TestCase around the time we decide to support the later version of Python as well.

Todo: For test suites where async_test (typically this is used in the decorator pattern i.e. @async_test) is used, replace TestCase with IsolatedAsyncioTestCase and remove decorator method usage.

Category (place an x in each of the [ ])

Requirements

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

seratch commented 3 years ago

@srajiang Thanks for creating the issue! I agree that we can use the base class in the future 👍 However, as we haven't decided when to drop supporting 3.6 / 3.7 (I'm sure that we will continue supporting them at least for one year, probably for years), let's remove the "good first issue" label from this issue at the moment.