@@ -2797,27 +2797,36 @@ msgid ""
2797
2797
" version of this example. (Contributed by Antoine Pitrou in "
2798
2798
":issue:`16997`.)"
2799
2799
msgstr ""
2800
+ "将得到六个子测试,在单元测试详细输出中各自以变量名 ``i`` 加该变量专属的值来标识 (``i=0``, ``i=1`` 等等)。 该示例的完整版本见"
2801
+ " :ref:`subtests`。 (由 Antoine Pitrou 在 :issue:`16997` 中贡献。)"
2800
2802
2801
2803
#: ../../whatsnew/3.4.rst:1676
2802
2804
msgid ""
2803
2805
":func:`unittest.main` now accepts an iterable of test names for "
2804
2806
"*defaultTest*, where previously it only accepted a single test name as a "
2805
2807
"string. (Contributed by Jyrki Pulliainen in :issue:`15132`.)"
2806
2808
msgstr ""
2809
+ "现在 :func:`unittest.main` 接受一个包含测试名称的可迭代对象作为 "
2810
+ "*defaultTest*,而在之前版本中它只接受单个字符串形式的测试名称。 (由 Jyrki Pulliainen 在 :issue:`15132` "
2811
+ "中贡献。)"
2807
2812
2808
2813
#: ../../whatsnew/3.4.rst:1680
2809
2814
msgid ""
2810
2815
"If :class:`~unittest.SkipTest` is raised during test discovery (that is, at "
2811
2816
"the module level in the test file), it is now reported as a skip instead of "
2812
2817
"an error. (Contributed by Zach Ware in :issue:`16935`.)"
2813
2818
msgstr ""
2819
+ "如果在测试发现期间(即在测试文件中的模块层级)引发了 :class:`~unittest.SkipTest`,现在它将被报告为跳过而不是错误。 (由 "
2820
+ "Zach Ware 在 :issue:`16935` 中贡献。)"
2814
2821
2815
2822
#: ../../whatsnew/3.4.rst:1684
2816
2823
msgid ""
2817
2824
":meth:`~unittest.TestLoader.discover` now sorts the discovered files to "
2818
2825
"provide consistent test ordering. (Contributed by Martin Melin and Jeff "
2819
2826
"Ramnani in :issue:`16709`.)"
2820
2827
msgstr ""
2828
+ "现在 :meth:`~unittest.TestLoader.discover` 会对所发现的文件进行排序以提供一致的测试顺序。 (由 Martin "
2829
+ "Melin 和 Jeff Ramnani 在 :issue:`16709` 中贡献。)"
2821
2830
2822
2831
#: ../../whatsnew/3.4.rst:1688
2823
2832
msgid ""
@@ -2829,6 +2838,10 @@ msgid ""
2829
2838
"defines a custom ``_removeTestAtIndex`` method. (Contributed by Tom "
2830
2839
"Wardill, Matt McClure, and Andrew Svetlov in :issue:`11798`.)"
2831
2840
msgstr ""
2841
+ "如果测试成功,现在 :class:`~unittest.TestSuite` 会在测试完成运行时立即丢弃对测试的引用。 在支持垃圾回收的 Python "
2842
+ "解释器上,这允许当没有其他对象持有对测试的引用时将该测试作为垃圾回收。 可以通过创建一个定义了自定义 ``_removeTestAtIndex`` "
2843
+ "方法的 :class:`~unittest.TestSuite` 子类来覆盖此行为。 (由 Tom Wardill, Matt McClure 和 "
2844
+ "Andrew Svetlov 在 :issue:`11798` 中贡献。)"
2832
2845
2833
2846
#: ../../whatsnew/3.4.rst:1696
2834
2847
msgid ""
@@ -3490,6 +3503,8 @@ msgid ""
3490
3503
"appropriate uses of :class:`io.TextIOWrapper` (if needed) and its *newline* "
3491
3504
"argument."
3492
3505
msgstr ""
3506
+ "各种 ``open`` 函数所接受的 ``U`` 模式已被弃用。 在 Python3 中它已不再有任何实际作用,并应当改用适当的 "
3507
+ ":class:`io.TextIOWrapper` (如有必要) 及其 *newline* 参数。"
3493
3508
3494
3509
#: ../../whatsnew/3.4.rst:2139
3495
3510
msgid ""
@@ -3498,6 +3513,9 @@ msgid ""
3498
3513
":func:`~xml.etree.ElementTree.XMLParser`. To prepare for the removal of the"
3499
3514
" latter, all arguments to ``XMLParser`` should be passed by keyword."
3500
3515
msgstr ""
3516
+ ":func:`xml.etree.ElementTree.iterparse` 的 *parser* 参数,就如 "
3517
+ ":func:`~xml.etree.ElementTree.XMLParser` 的 *html* 参数一样。 要对后者的移除做好准备,所有 "
3518
+ "``XMLParser`` 的参数都应当以关键字形式传入。"
3501
3519
3502
3520
#: ../../whatsnew/3.4.rst:2146
3503
3521
msgid "Deprecated Features"
@@ -3508,12 +3526,14 @@ msgid ""
3508
3526
"Running :ref:`idle` with the ``-n`` flag (no subprocess) is deprecated. "
3509
3527
"However, the feature will not be removed until :issue:`18823` is resolved."
3510
3528
msgstr ""
3529
+ "运行 :ref:`idle` 时附带 ``-n`` 旗标(无子进程)的做法已被弃用。 但是,该特性在 :issue:`18823` "
3530
+ "解决之前将不会被移除。"
3511
3531
3512
3532
#: ../../whatsnew/3.4.rst:2151
3513
3533
msgid ""
3514
3534
"The site module adding a \" site-python\" directory to sys.path, if it "
3515
3535
"exists, is deprecated (:issue:`19375`)."
3516
- msgstr ""
3536
+ msgstr "site 模块在 \" site-python \" 目录存在的情况下 sys.path 添加该目录的做法已被弃用 (:issue:`19375`)。 "
3517
3537
3518
3538
#: ../../whatsnew/3.4.rst:2157
3519
3539
msgid "Removed"
@@ -3563,6 +3583,8 @@ msgid ""
3563
3583
"removed (see the `devguide <https://devguide.python.org>`_ for suggestions "
3564
3584
"on what to use instead)."
3565
3585
msgstr ""
3586
+ "不再继续维护的 ``Misc/TextMate`` 和 ``Misc/vim`` 目录已被移除(请参阅 `devguide "
3587
+ "<https://devguide.python.org>`_ 了解相关替代器的使用建议)。"
3566
3588
3567
3589
#: ../../whatsnew/3.4.rst:2182
3568
3590
msgid ""
0 commit comments