@@ -2281,27 +2281,38 @@ msgid ""
22812281"tests returned by this method unless the caller uses a subclass that "
22822282"overrides :meth:`TestSuite._removeTestAtIndex` to preserve test references."
22832283msgstr ""
2284+ "由 :class:`TestSuite` 分组的测试总是可以通过迭代来访问。 其子类可以通过重载 :meth:`__iter__` 来惰性地提供测试。 "
2285+ "请注意此方法可在单个套件上多次被调用(例如在计数测试或相等性比较时),为此在 :meth:`TestSuite.run` "
2286+ "之前重复迭代所返回的测试对于每次调用迭代都必须相同。 在 :meth:`TestSuite.run` "
2287+ "之后,调用方不应继续访问此方法所返回的测试,除非调用方使用重载了 :meth:`TestSuite._removeTestAtIndex` "
2288+ "的子类来保留对测试的引用。"
22842289
22852290#: ../../library/unittest.rst:1688
22862291msgid ""
22872292"In earlier versions the :class:`TestSuite` accessed tests directly rather "
22882293"than through iteration, so overriding :meth:`__iter__` wasn't sufficient for"
22892294" providing tests."
22902295msgstr ""
2296+ "在较早的版本中 :class:`TestSuite` 会直接访问测试而不是通过迭代,因此只重载 :meth:`__iter__` 并不足以提供所有测试。"
22912297
22922298#: ../../library/unittest.rst:1693
22932299msgid ""
22942300"In earlier versions the :class:`TestSuite` held references to each "
22952301":class:`TestCase` after :meth:`TestSuite.run`. Subclasses can restore that "
22962302"behavior by overriding :meth:`TestSuite._removeTestAtIndex`."
22972303msgstr ""
2304+ "在较早的版本中 :class:`TestSuite` 会在 :meth:`TestSuite.run` 之后保留对每个 "
2305+ ":class:`TestCase` 的引用。 其子类可以通过重载 :meth:`TestSuite._removeTestAtIndex` "
2306+ "来恢复此行为。"
22982307
22992308#: ../../library/unittest.rst:1698
23002309msgid ""
23012310"In the typical usage of a :class:`TestSuite` object, the :meth:`run` method "
23022311"is invoked by a :class:`TestRunner` rather than by the end-user test "
23032312"harness."
23042313msgstr ""
2314+ "在 :class:`TestSuite` 对象的典型应用中,:meth:`run` 方法是由 :class:`TestRunner` "
2315+ "发起调用而不是由最终用户测试来控制。"
23052316
23062317#: ../../library/unittest.rst:1703
23072318msgid "Loading and running tests"
0 commit comments