55#
66# Translators:
77# python-doc bot, 2025
8+ # Freesand Leo <yuqinju@163.com>, 2025
89#
910#, fuzzy
1011msgid ""
@@ -13,7 +14,7 @@ msgstr ""
1314"Report-Msgid-Bugs-To : \n "
1415"POT-Creation-Date : 2025-11-23 14:12+0000\n "
1516"PO-Revision-Date : 2025-09-16 00:02+0000\n "
16- "Last-Translator : python-doc bot , 2025\n "
17+ "Last-Translator : Freesand Leo <yuqinju@163.com> , 2025\n "
1718"Language-Team : Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n "
1819"MIME-Version : 1.0\n "
1920"Content-Type : text/plain; charset=UTF-8\n "
@@ -809,6 +810,9 @@ msgid ""
809810":meth:`~TestCase.tearDown`, and :meth:`!TestCase.__init__` will be called "
810811"once per test."
811812msgstr ""
813+ "这种用于测试代码的工作环境称为 :dfn:`test fixture`。 一个新的 TestCase 实例将作为一个单独的 test fixture "
814+ "被创建用于执行各个独立的测试方法。 这样 :meth:`~TestCase.setUp`, :meth:`~TestCase.tearDown` 和 "
815+ ":meth:`!TestCase.__init__` 将在每个测试中被调用一次。"
812816
813817#: ../../library/unittest.rst:444
814818msgid ""
@@ -967,6 +971,9 @@ msgid ""
967971":class:`unittest.TestSuite` instances from the existing :mod:`doctest`\\ "
968972"-based tests."
969973msgstr ""
974+ "在某些情况下,现有的测试可能是用 :mod:`doctest` 模块编写的。 如果是这样,:mod:`doctest` 提供了一个 "
975+ ":class:`~doctest.DocTestSuite` 类可以根据现有的基于 :mod:`doctest` 的测试自动构建 "
976+ ":class:`unittest.TestSuite` 实例。"
970977
971978#: ../../library/unittest.rst:529
972979msgid "Skipping tests and expected failures"
@@ -1858,7 +1865,7 @@ msgid ""
18581865"The context manager will store the caught exception object in its "
18591866":attr:`!exception` attribute. This can be useful if the intention is to "
18601867"perform additional checks on the exception raised::"
1861- msgstr ""
1868+ msgstr "上下文管理器将把捕获的异常对象存储在其 :attr:`!exception` 属性中。 这适用于需要对所引发异常执行额外检测的场合:: "
18621869
18631870#: ../../library/unittest.rst:1029
18641871msgid ""
@@ -1880,7 +1887,7 @@ msgstr "添加了将 :meth:`assertRaises` 用作上下文管理器的功能。"
18801887
18811888#: ../../library/unittest.rst:1038
18821889msgid "Added the :attr:`!exception` attribute."
1883- msgstr ""
1890+ msgstr "增加了 :attr:`!exception` 属性。 "
18841891
18851892#: ../../library/unittest.rst:1041 ../../library/unittest.rst:1067
18861893#: ../../library/unittest.rst:1108 ../../library/unittest.rst:1131
@@ -1965,6 +1972,8 @@ msgid ""
19651972" in the :attr:`!filename` and :attr:`!lineno` attributes. This can be useful"
19661973" if the intention is to perform additional checks on the warning caught::"
19671974msgstr ""
1975+ "上下文管理器将把捕获的警告对象保存在其 :attr:`!warning` 属性中,并把触发警告的源代码行保存在 :attr:`!filename` 和 "
1976+ ":attr:`!lineno` 属性中。 这适用于需要对捕获的警告执行额外检查的场合::"
19681977
19691978#: ../../library/unittest.rst:1097
19701979msgid ""
@@ -2469,7 +2478,7 @@ msgstr ""
24692478msgid ""
24702479"Fails if either of *first* or *second* does not have a "
24712480":meth:`~frozenset.difference` method."
2472- msgstr ""
2481+ msgstr "如果 *first* 或 *second* 没有 :meth:`~frozenset.difference` 方法则测试失败。 "
24732482
24742483#: ../../library/unittest.rst:1441
24752484msgid ""
@@ -2719,6 +2728,9 @@ msgid ""
27192728"raised by this method will be considered an error rather than a test "
27202729"failure. The default implementation does nothing."
27212730msgstr ""
2731+ "为准备 test fixture 而调用的方法。 此方法会在 :meth:`TestCase.setUp` 之后被调用。 "
2732+ "它将在调用测试方法之前立即被调用;除了 :exc:`AssertionError` 或 "
2733+ ":exc:`SkipTest`,此方法所引发的任何异常都将被视为错误而非测试失败。 默认的实现将不做任何事情。"
27222734
27232735#: ../../library/unittest.rst:1650
27242736msgid ""
@@ -3416,6 +3428,8 @@ msgid ""
34163428"keyboard. Interactive tools which provide :class:`!TestRunner` "
34173429"implementations can use this in a similar manner."
34183430msgstr ""
3431+ "例如,该特性会被 :class:`TextTestRunner` 类用来在用户从键盘发出一个中断信号时停止测试框架。 提供了 "
3432+ ":class:`!TestRunner` 实现的交互式工具也可通过类似方式来使用该特性。"
34193433
34203434#: ../../library/unittest.rst:2148
34213435msgid ""
@@ -3922,6 +3936,9 @@ msgid ""
39223936":meth:`~TestCase.tearDownClass` from the previous class (if there is one) is"
39233937" called, followed by :meth:`~TestCase.setUpClass` from the new class."
39243938msgstr ""
3939+ "类和模块级的 fixture 是在 :class:`TestSuite` 中实现的。 当测试套件遇到来自新类的测试时来自之前的类(如果有)的 "
3940+ ":meth:`~TestCase.tearDownClass` 会被调用,然后再调用来自新类的 "
3941+ ":meth:`~TestCase.setUpClass`。"
39253942
39263943#: ../../library/unittest.rst:2469
39273944msgid ""
0 commit comments