Ability to run single test methods or classes
还没有人认领这个 Issue。
评估
调研方向
Start at the unit_testing build target and its existing support for module patterns, using the build configuration for test_create_snippet_from_sel.py as the reference case. Trace how a pattern is passed to the test runner, then verify that pytest-style paths can select a test class and method as requested.
由索引模型根据 Issue 内容生成。
描述
This is a common use case, supported both by unittest and pytest. E.g. in unittest I can run an individual test method with:
python3 -m unittest somelib.tests.test_process.TestProcess.test_kill
With pytest:
python3 -m pytest mylib/tests/test_process.py::TestProcess::test_kill
Apparently with UnitTesting it's possible to specify a single test module to run, but not a test class or a test method.
Right now I am running individual test modules by using this build config:
"build_systems": [
{
"name": "Sublime tests:",
"target": "unit_testing",
"package": "mypackage",
"variants": [
{"name": "test_create_snippet_from_sel.py", "pattern": "test_create_snippet_from_sel.py"},
]
}
I would like to be able to specify something like (mimicking pytest style):
{"name": "test_kill", "pattern": "test_create_snippet_from_sel.py::TestProcess::test_kill"},
To give even more context about my specific use case: I have a dynamic build system able to run individual test methods based on the cursor position (see ST forum post). I did this for both pytest and unittest. I would like to do the same by using UnitTesting.
@randy3k if you like the idea I can try working on a PR.
- 主要语言
- Python
- 星标
- 113
- 派生
- 32
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
SublimeText/UnitTesting 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 48/100
SublimeText/UnitTesting#286 · 3 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
SublimeText/UnitTesting#276 · 4 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
SublimeText/UnitTesting#155 · 8 条评论 ·
-
难度 5/5 一周以上 新手友好度 25/100
SublimeText/UnitTesting#31 · 5 条评论 ·
查看 SublimeText/UnitTesting 的全部 Issue
相似的 Issue
-
triage/confirmed
难度 2/5 1-3 小时 新手友好度 88/100
agentscope-ai/agentscope#2775 ·
-
comp/desktop P3 type/bug
难度 1/5 1 小时以内 新手友好度 92/100
NousResearch/hermes-agent#118866 ·
-
bug
难度 1/5 1 小时以内 新手友好度 90/100
apache/cloudstack#14222 ·
-
难度 2/5 1-3 小时 新手友好度 76/100
-
bug
难度 2/5 1-3 小时 新手友好度 82/100