@@ -728,6 +728,9 @@ msgid ""
728728":meth:`warnings.simplefilter` set to ``always`` and with the option to "
729729"automatically validate the results that are recorded."
730730msgstr ""
731+ "一个用于 :func:`warnings.catch_warnings()` 以更容易地测试特定警告是否被正确引发的便捷包装器。 它大致等价于调用 "
732+ "``warnings.catch_warnings(record=True)`` 并将 :meth:`warnings.simplefilter` 设为"
733+ " ``always`` 并附带自动验证已记录结果的选项。"
731734
732735#: ../../library/test.rst:601
733736msgid ""
@@ -799,6 +802,8 @@ msgid ""
799802"must remove the object which may emit :exc:`ResourceWarning` before the end "
800803"of the context manager."
801804msgstr ""
805+ "检测是否没有任何 :exc:`ResourceWarning` 被引发的上下文管理器。 你必须在该上下文管理器结束之前移除可能发出 "
806+ ":exc:`ResourceWarning` 的对象。"
802807
803808#: ../../library/test.rst:668
804809msgid ""
@@ -1200,6 +1205,11 @@ msgid ""
12001205"``None``, compares to the line of the warning and exception. If *offset* is "
12011206"not ``None``, compares to the offset of the exception."
12021207msgstr ""
1208+ "用于通过尝试编译 *statement* 来测试 *statement* 中的语法警告。 还会测试 :exc:`SyntaxWarning` "
1209+ "是否只发出了一次,以及它在转成错误时是否将被转换为 :exc:`SyntaxError`。 *testcase* 是用于测试的 "
1210+ ":mod:`unittest` 实例。 *errtext* 是应当匹配所发出的 :exc:`SyntaxWarning` 以及所引发的 "
1211+ ":exc:`SyntaxError` 的字符串表示形式的正则表达式。 如果 *lineno* 不为 ``None``,则与警告和异常所在的行进行比较。 "
1212+ "如果 *offset* 不为 ``None``,则与异常的偏移量进行比较。"
12031213
12041214#: ../../library/test.rst:1049
12051215msgid "Open *url*. If open fails, raises :exc:`TestFailed`."
@@ -1552,13 +1562,15 @@ msgid ""
15521562"positional arguments, then reverts :data:`sys.path` to the copied settings "
15531563"when the context ends."
15541564msgstr ""
1565+ "这将创建 :data:`sys.path` 的一个副本,添加作为位置参数传入的任何目录,然后在上下文结束时将 :data:`sys.path` "
1566+ "还原到副本的设置。"
15551567
15561568#: ../../library/test.rst:1371
15571569msgid ""
15581570"Note that *all* :data:`sys.path` modifications in the body of the context "
15591571"manager, including replacement of the object, will be reverted at the end of"
15601572" the block."
1561- msgstr ""
1573+ msgstr "请注意该上下文管理器代码块中 *所有* 对 :data:`sys.path` 的修改,包括对象的替换,都将在代码块结束时被还原。 "
15621574
15631575#: ../../library/test.rst:1378
15641576msgid ""
0 commit comments