一个pytest插件,用于通过将测试分成大小相等的组来运行测试的子集。
pytest-test-groups的Python项目详细描述
欢迎来到pytest测试组!
pytest测试组允许您将测试运行分成 大小以便于分割测试运行。
使用量
# Install pytest-test-groups pip install pytest-test-groups # Split the tests into 10 groups and run the second group py.test --test-group-count 10 --test-group=2 # Randomize the test order, split into 10 groups, and run the second group py.test --test-group-count 10 --test-group=2 --test-group-random-seed=12345
我为什么要用这个?
有时,您可能有一些长时间运行的测试作业需要 同时完成。当你试图 快速运行测试。pytest测试组允许您轻松地说 “将我的测试分成10个测试组并运行第二组”。 这主要适用于ci构建的上下文。