@@ -3242,7 +3242,7 @@ msgid ""
32423242"Note that shared fixtures do not play well with [potential] features like "
32433243"test parallelization and they break test isolation. They should be used with"
32443244" care."
3245- msgstr ""
3245+ msgstr "请注意共享设定不适用于一些 [潜在的] 特性例如测试并行化并且它们会破坏测试隔离。 它们应当被谨慎地使用。 "
32463246
32473247#: ../../library/unittest.rst:2356
32483248msgid ""
@@ -3253,13 +3253,16 @@ msgid ""
32533253"modules and classes are adjacent to each other, then these shared fixture "
32543254"functions may be called multiple times in a single test run."
32553255msgstr ""
3256+ "由 unittest 测试加载器创建的测试的默认顺序是将所有来自相同模块和类的测试归入相同分组。 这将导致 ``setUpClass`` / "
3257+ "``setUpModule`` (等) 对于每个类和模块都恰好被调用一次。 "
3258+ "如果你将顺序随机化,以便使得来自不同模块和类的测试彼此相邻,那么这些共享的设定函数就可能会在一次测试运行中被多次调用。"
32563259
32573260#: ../../library/unittest.rst:2363
32583261msgid ""
32593262"Shared fixtures are not intended to work with suites with non-standard "
32603263"ordering. A ``BaseTestSuite`` still exists for frameworks that don't want to"
32613264" support shared fixtures."
3262- msgstr ""
3265+ msgstr "共享的设定不适用与非标准顺序的套件。 对于不想支持共享设定的框架来说 ``BaseTestSuite`` 仍然可用。 "
32633266
32643267#: ../../library/unittest.rst:2367
32653268msgid ""
@@ -3270,6 +3273,9 @@ msgid ""
32703273"are just using the standard unittest test runner then this detail doesn't "
32713274"matter, but if you are a framework author it may be relevant."
32723275msgstr ""
3276+ "如果在共享的设定函数中引发了任何异常则测试将被报告错误。 因为没有对应的测试实例,所以会创建一个 ``_ErrorHolder`` 对象(它具有与 "
3277+ ":class:`TestCase` 相同的接口)来代表该错误。 如果你只是使用标准 unittest "
3278+ "测试运行器那么这个细节并不重要,但是如果你是一个框架开发者那么这可能会有关系。"
32733279
32743280#: ../../library/unittest.rst:2376
32753281msgid "setUpClass and tearDownClass"
0 commit comments