Clarify: Test Object `name` and `suite`
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 45/100
- Issue 类型
- 文档
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- python
调研方向
从第 9.4 节(name)和第 9.9 节(suite)开始,然后将它们的措辞与 issue 中的 Python unittest 示例进行比较。明确方法名称、测试标题和 suite 层级应如何表示,包括标题应属于标准字段还是额外字段;当规范给出明确无歧义的建议时即完成。
由索引模型根据 Issue 内容生成。
描述
Please clarify how to document a tests:
- title
- name
- suite hierarchy
Current State of the Spec
Under section "9.4. name" the spec says:
The name or title of the test case.
Under section "9.9. suite" the spec says:
An ordered list of suite or grouping names to which this test belongs, ordered from the top-level suite to the immediate parent of the test.
Situation for xUnit (i.e. Python unittest)
Best explained with an example:
File tests/test_ping.py:
class TestPingTestCase(unittest.TestCase):
def test_icmp_ping(self):
"""Test Reachability With ICMP Ping
"""
... # test code omitted
I would like to document:
- the suite the test belongs to:
["tests", "test_ping", "TestPingTestCase"] - the tests method name:
"test_icmp_ping" - the tests title (from the so called doc-string):
"Test Reachability With ICMP Ping"
- According to "9.9 suite", the test methods name does not belong to
suite:to the immediate parent of the test
- Now is left "9.4 name": To ensure that the test can be clearly identified, I need to choose as name the test methods name (
"test_icmp_ping"). Also the test method always exists. - The title of the test (
"Test Reachability With ICMP Ping") therefore can't be taken into account. Documenting a test is optional anyway and could be documented within e.g.results.tests[].extra.<NAMESPACE>.title.
Resulting in:
- set
nameto"test_icmp_ping" - set
suiteto["tests", "test_ping", "TestPingTestCase"] - omit the tests title or e.g. set
results.tests[].extra.<NAMESPACE>.titleto"Test Reachability With ICMP Ping"
Evaluated and Rejected Alternatives:
- Add the tests method name to the "suite" like this:
["tests", "test_ping", "TestPingTestCase", "test_icmp_ping"]and document the optional title under "name". This contradicts the spec forsuitestating the "up to the immediate parent" andnamebeing mandatory. --> No go - Keep
suite"up to the immediate parent" (["tests", "test_ping", "TestPingTestCase"]) and setnameto"test_icmp_ping: Test Reachability With ICMP Ping"to include both the tests method name and title (if available). This potentially could put a burden to the consumer being able to split the method name from the optional title. --> Bad
Would you also recommend to omit the tests title?
- 主要语言
- 没有语言数据
- 星标
- 99
- 派生
- 4
- 平均合并
- 1 小时 3 分钟
- 30 天内合并 PR
- 2
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ctrf-io/ctrf 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 76/100
-
难度 3/5 半天 新手友好度 32/100
-
难度 4/5 1-2 天 新手友好度 48/100
-
难度 5/5 一周以上 新手友好度 35/100
-
难度 5/5 一周以上 新手友好度 30/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
components-web-app/docs#245 ·
-
难度 1/5 1-3 小时 新手友好度 75/100
siyuan-note/siyuan#20629 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
aws-samples/sample-per-model-bedrock#261 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
-
难度 1/5 1 小时以内 新手友好度 82/100