--test-randomize


随机化测试执行顺序。这适用于测试文件的执行顺序以及每个文件中排队的测试。这有助于检测依赖共享状态或执行顺序的测试。

🌐 Randomize test execution order. This applies to both test file execution order and queued tests within each file. This can help detect tests that rely on shared state or execution order.

用于随机化的种子会打印在测试摘要中,并且可以与 --test-random-seed 一起重复使用。

🌐 The seed used for randomization is printed in the test summary and can be reused with --test-random-seed.

有关详细行为和示例,请参见 随机化测试执行顺序

🌐 For detailed behavior and examples, see randomizing tests execution order.

此标志无法与 --watch--test-rerun-failures 一起使用。

🌐 This flag cannot be used with --watch or --test-rerun-failures.