@@ -2352,7 +2352,7 @@ msgstr ":class:`TestLoader` 对象具有下列方法:"
23522352msgid ""
23532353"Return a suite of all test cases contained in the :class:`TestCase`\\ "
23542354"-derived :class:`testCaseClass`."
2355- msgstr ""
2355+ msgstr "返回一个包含在 :class:`TestCase` 所派生的 :class:`testCaseClass` 中的所有测试用例的测试套件。 "
23562356
23572357#: ../../library/unittest.rst:1735
23582358msgid ""
@@ -2362,13 +2362,18 @@ msgid ""
23622362":meth:`runTest` method is implemented, a single test case is created for "
23632363"that method instead."
23642364msgstr ""
2365+ "会为每个由 :meth:`getTestCaseNames` 指明的方法创建一个测试用例实例。 在默认情况下这些都是以 ``test`` "
2366+ "开头的方法名称。 如果 :meth:`getTestCaseNames` 不返回任何方法,但 :meth:`runTest` "
2367+ "方法已被实现,则会为该方法创建一个单独的测试用例。"
23652368
23662369#: ../../library/unittest.rst:1744
23672370msgid ""
23682371"Return a suite of all test cases contained in the given module. This method "
23692372"searches *module* for classes derived from :class:`TestCase` and creates an "
23702373"instance of the class for each test method defined for the class."
23712374msgstr ""
2375+ "返回包含在给定模块中的所有测试用例的测试套件。 此方法会在 *module* 中搜索从派生自 :class:`TestCase` "
2376+ "的类并为该类定义的每个测试方法创建一个类实例。"
23722377
23732378#: ../../library/unittest.rst:1751
23742379msgid ""
@@ -2378,6 +2383,9 @@ msgid ""
23782383"play well with this method. Doing so, however, can be useful when the "
23792384"fixtures are different and defined in subclasses."
23802385msgstr ""
2386+ "虽然使用 :class:`TestCase` "
2387+ "所派生的类的层级结构可以方便地共享配置和辅助函数,但在不打算直接实例化的基类上定义测试方法并不能很好地配合此方法使用。 "
2388+ "不过,当配置有差异并且定义在子类当中时这样做还是有用处的。"
23812389
23822390#: ../../library/unittest.rst:1757
23832391msgid ""
@@ -2386,6 +2394,8 @@ msgid ""
23862394"`load_tests protocol`_. The *pattern* argument is passed as the third "
23872395"argument to ``load_tests``."
23882396msgstr ""
2397+ "如果一个模块提供了 ``load_tests`` 函数则它将被调用以加载测试。 这允许模块自行定制测试加载过程。 这就称为 `load_tests "
2398+ "protocol`_。 *pattern* 参数会被作为传给 ``load_tests`` 的第三个参数。"
23892399
23902400#: ../../library/unittest.rst:1762
23912401msgid "Support for ``load_tests`` added."
0 commit comments