@@ -620,6 +620,9 @@ msgid ""
620620":meth:`warnings.simplefilter` set to ``always`` and with the option to "
621621"automatically validate the results that are recorded."
622622msgstr ""
623+ "一个用于 :func:`warnings.catch_warnings()` 以更容易地测试特定警告是否被正确引发的便捷包装器。 它大致等价于调用 "
624+ "``warnings.catch_warnings(record=True)`` 并将 :meth:`warnings.simplefilter` 设为"
625+ " ``always`` 并附带自动验证已记录结果的选项。"
623626
624627#: ../../library/test.rst:539
625628msgid ""
@@ -691,6 +694,8 @@ msgid ""
691694"must remove the object which may emit :exc:`ResourceWarning` before the end "
692695"of the context manager."
693696msgstr ""
697+ "检测是否没有任何 :exc:`ResourceWarning` 被引发的上下文管理器。 你必须在该上下文管理器结束之前移除可能发出 "
698+ ":exc:`ResourceWarning` 的对象。"
694699
695700#: ../../library/test.rst:606
696701msgid ""
@@ -1081,6 +1086,11 @@ msgid ""
10811086"``None``, compares to the line of the warning and exception. If *offset* is "
10821087"not ``None``, compares to the offset of the exception."
10831088msgstr ""
1089+ "用于通过尝试编译 *statement* 来测试 *statement* 中的语法警告。 还会测试 :exc:`SyntaxWarning` "
1090+ "是否只发出了一次,以及它在转成错误时是否将被转换为 :exc:`SyntaxError`。 *testcase* 是用于测试的 "
1091+ ":mod:`unittest` 实例。 *errtext* 是应当匹配所发出的 :exc:`SyntaxWarning` 以及所引发的 "
1092+ ":exc:`SyntaxError` 的字符串表示形式的正则表达式。 如果 *lineno* 不为 ``None``,则与警告和异常所在的行进行比较。 "
1093+ "如果 *offset* 不为 ``None``,则与异常的偏移量进行比较。"
10841094
10851095#: ../../library/test.rst:982
10861096msgid "Open *url*. If open fails, raises :exc:`TestFailed`."
0 commit comments