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:59+0000\n "
1516"PO-Revision-Date : 2025-09-15 01:05+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 "
@@ -817,6 +818,9 @@ msgid ""
817818":meth:`~TestCase.tearDown`, and :meth:`!TestCase.__init__` will be called "
818819"once per test."
819820msgstr ""
821+ "这种用于测试代码的工作环境称为 :dfn:`test fixture`。 一个新的 TestCase 实例将作为一个单独的 test fixture "
822+ "被创建用于执行各个独立的测试方法。 这样 :meth:`~TestCase.setUp`, :meth:`~TestCase.tearDown` 和 "
823+ ":meth:`!TestCase.__init__` 将在每个测试中被调用一次。"
820824
821825#: ../../library/unittest.rst:449
822826msgid ""
@@ -975,6 +979,9 @@ msgid ""
975979":class:`unittest.TestSuite` instances from the existing :mod:`doctest`\\ "
976980"-based tests."
977981msgstr ""
982+ "在某些情况下,现有的测试可能是用 :mod:`doctest` 模块编写的。 如果是这样,:mod:`doctest` 提供了一个 "
983+ ":class:`~doctest.DocTestSuite` 类可以根据现有的基于 :mod:`doctest` 的测试自动构建 "
984+ ":class:`unittest.TestSuite` 实例。"
978985
979986#: ../../library/unittest.rst:534
980987msgid "Skipping tests and expected failures"
@@ -1834,7 +1841,7 @@ msgid ""
18341841"The context manager will store the caught exception object in its "
18351842":attr:`!exception` attribute. This can be useful if the intention is to "
18361843"perform additional checks on the exception raised::"
1837- msgstr ""
1844+ msgstr "上下文管理器将把捕获的异常对象存储在其 :attr:`!exception` 属性中。 这适用于需要对所引发异常执行额外检测的场合:: "
18381845
18391846#: ../../library/unittest.rst:1019
18401847msgid ""
@@ -1856,7 +1863,7 @@ msgstr "添加了将 :meth:`assertRaises` 用作上下文管理器的功能。"
18561863
18571864#: ../../library/unittest.rst:1028
18581865msgid "Added the :attr:`!exception` attribute."
1859- msgstr ""
1866+ msgstr "增加了 :attr:`!exception` 属性。 "
18601867
18611868#: ../../library/unittest.rst:1031 ../../library/unittest.rst:1057
18621869#: ../../library/unittest.rst:1098 ../../library/unittest.rst:1121
@@ -1941,6 +1948,8 @@ msgid ""
19411948" in the :attr:`!filename` and :attr:`!lineno` attributes. This can be useful"
19421949" if the intention is to perform additional checks on the warning caught::"
19431950msgstr ""
1951+ "上下文管理器将把捕获的警告对象保存在其 :attr:`!warning` 属性中,并把触发警告的源代码行保存在 :attr:`!filename` 和 "
1952+ ":attr:`!lineno` 属性中。 这适用于需要对捕获的警告执行额外检查的场合::"
19441953
19451954#: ../../library/unittest.rst:1087
19461955msgid ""
@@ -2381,7 +2390,7 @@ msgstr ""
23812390msgid ""
23822391"Fails if either of *first* or *second* does not have a "
23832392":meth:`~frozenset.difference` method."
2384- msgstr ""
2393+ msgstr "如果 *first* 或 *second* 没有 :meth:`~frozenset.difference` 方法则测试失败。 "
23852394
23862395#: ../../library/unittest.rst:1385
23872396msgid ""
@@ -2631,6 +2640,9 @@ msgid ""
26312640"raised by this method will be considered an error rather than a test "
26322641"failure. The default implementation does nothing."
26332642msgstr ""
2643+ "为准备 test fixture 而调用的方法。 此方法会在 :meth:`TestCase.setUp` 之后被调用。 "
2644+ "它将在调用测试方法之前立即被调用;除了 :exc:`AssertionError` 或 "
2645+ ":exc:`SkipTest`,此方法所引发的任何异常都将被视为错误而非测试失败。 默认的实现将不做任何事情。"
26342646
26352647#: ../../library/unittest.rst:1594
26362648msgid ""
@@ -3324,6 +3336,8 @@ msgid ""
33243336"keyboard. Interactive tools which provide :class:`!TestRunner` "
33253337"implementations can use this in a similar manner."
33263338msgstr ""
3339+ "例如,该特性会被 :class:`TextTestRunner` 类用来在用户从键盘发出一个中断信号时停止测试框架。 提供了 "
3340+ ":class:`!TestRunner` 实现的交互式工具也可通过类似方式来使用该特性。"
33273341
33283342#: ../../library/unittest.rst:2092
33293343msgid ""
@@ -3830,6 +3844,9 @@ msgid ""
38303844":meth:`~TestCase.tearDownClass` from the previous class (if there is one) is"
38313845" called, followed by :meth:`~TestCase.setUpClass` from the new class."
38323846msgstr ""
3847+ "类和模块级�� fixture 是在 :class:`TestSuite` 中实现的。 当测试套件遇到来自新类的测试时来自之前的类(如果有)的 "
3848+ ":meth:`~TestCase.tearDownClass` 会被调用,然后再调用来自新类的 "
3849+ ":meth:`~TestCase.setUpClass`。"
38333850
38343851#: ../../library/unittest.rst:2413
38353852msgid ""
0 commit comments