slackapi / slackapi/python-slack-sdk
Update async unit tests to use unittest.IsolatedAsyncioTestCase base classes
还没有人认领这个 Issue。
- 主要语言
- Python
- 星标
- 4k
- 派生
- 857
- 平均合并
- 22 小时 21 分钟
- 30 天内合并 PR
- 16
描述
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 [ ])
- slack_sdk.web.WebClient (sync/async) (Web API client)
- slack_sdk.webhook.WebhookClient (sync/async) (Incoming Webhook, response_url sender)
- slack_sdk.models (UI component builders)
- slack_sdk.oauth (OAuth Flow Utilities)
- slack_sdk.socket_mode (Socket Mode client)
- slack_sdk.audit_logs (Audit Logs API client)
- slack_sdk.scim (SCIM API client)
- slack_sdk.rtm (RTM client)
- slack_sdk.signature (Request Signature Verifier)
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.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
在 WebClient 和 WebhookClient 测试套件的单元测试中搜索 async_test 辅助工具,尤其是它作为装饰器的用法以及 TestCase 基类。将这些用法替换为 unittest.IsolatedAsyncioTestCase,移除装饰器方法的用法,并运行受影响的测试套件以确认它们仍然通过。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- testing-qa
- Issue 类型
- 重构
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100