File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2425,6 +2425,10 @@ msgid ""
24252425"will be picked up as \" a test method within a test case class\" , rather than"
24262426" \" a callable object\" ."
24272427msgstr ""
2428+ "描述名称 *name* 是一个“带点号的名称”,它可以被解析为一个模块、一个测试用例类、一个测试用例类内部的测试方法、一个 "
2429+ ":class:`TestSuite` 实例,或者一个返回 :class:`TestCase` 或 :class:`TestSuite` "
2430+ "实例的可调用对象。 "
2431+ "这些检查将按在此列出的顺序执行;也就是说,一个可能的测试用例类上的方法将作为“一个测试用例内部的测试方法”而非作为“一个可调用对象”被选定。"
24282432
24292433#: ../../library/unittest.rst:1784
24302434msgid ""
@@ -2438,6 +2442,11 @@ msgid ""
24382442"can refer to modules and packages which have not been imported; they will be"
24392443" imported as a side-effect."
24402444msgstr ""
2445+ "举例来说,如果你有一个模块 :mod:`SampleTests`,其中包含一个派生自 :class:`TestCase` 的类 "
2446+ ":class:`SampleTestCase`,其中包含三个测试方法 (:meth:`test_one`, :meth:`test_two` 和 "
2447+ ":meth:`test_three`)。 则描述名称 ``'SampleTests.SampleTestCase'`` "
2448+ "将使此方法返回一个测试套件,它将运行全部三个测试方法。 使用描述名称 ``'SampleTests.SampleTestCase.test_two'``"
2449+ " 将使它返回一个测试套件,它将仅运行 :meth:`test_two` 测试方法。 描述名称可以指向尚未被导入的模块和包;它们将作为附带影响被导入。"
24412450
24422451#: ../../library/unittest.rst:1794
24432452msgid "The method optionally resolves *name* relative to the given *module*."
You can’t perform that action at this time.
0 commit comments