@@ -3278,12 +3278,14 @@ msgid ""
32783278"exception is a :exc:`SkipTest` exception then the module will be reported as"
32793279" having been skipped instead of as an error."
32803280msgstr ""
3281+ "如果在 ``setUpModule`` 中引发了异常则模块中的任何测试都将不会被运行并且 ``tearDownModule`` 也不会被运行。 "
3282+ "如果引发的异常是 :exc:`SkipTest` 异常则模块将被报告为已跳过而非发生错误。"
32813283
32823284#: ../../library/unittest.rst:2395
32833285msgid ""
32843286"To add cleanup code that must be run even in the case of an exception, use "
32853287"``addModuleCleanup``:"
3286- msgstr ""
3288+ msgstr "要添加即使在发生异常时也必须运行的清理代码,请使用 ``addModuleCleanup``: "
32873289
32883290#: ../../library/unittest.rst:2401
32893291msgid ""
@@ -3293,18 +3295,24 @@ msgid ""
32933295"are called with any arguments and keyword arguments passed into "
32943296":meth:`addModuleCleanup` when they are added."
32953297msgstr ""
3298+ "在 :func:`tearDownModule` 之后添加一个要调用的函数来清理测试类运行期间所使用的资源。 函数将按它们被添加的相反顺序被调用 "
3299+ "(:abbr:`LIFO (last-in, first-out)`)。 它们在调用时将附带它们被添加时传给 "
3300+ ":meth:`addModuleCleanup` 的任何参数和关键字参数。"
32963301
32973302#: ../../library/unittest.rst:2407
32983303msgid ""
32993304"If :meth:`setUpModule` fails, meaning that :func:`tearDownModule` is not "
33003305"called, then any cleanup functions added will still be called."
33013306msgstr ""
3307+ "如果 :meth:`setUpModule` 失败,即意味着 :func:`tearDownModule` 未被调用,则已添加的任何清理函数仍将被调用。"
33023308
33033309#: ../../library/unittest.rst:2415
33043310msgid ""
33053311"This function is called unconditionally after :func:`tearDownModule`, or "
33063312"after :func:`setUpModule` if :func:`setUpModule` raises an exception."
33073313msgstr ""
3314+ "此函数会在 :func:`tearDownModule` 之后无条件地被调用,或者如果 :func:`setUpModule` 引发了异常则会在 "
3315+ ":func:`setUpModule` 之后被调用。"
33083316
33093317#: ../../library/unittest.rst:2418
33103318msgid ""
0 commit comments