如何加快muticore机器上的python unittest? [英] How to speedup python unittest on muticore machines?

查看:89
本文介绍了如何加快muticore机器上的python unittest?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用python unittest来测试其他一些外部应用程序,但是一个接一个地运行测试会花费太多时间.

I'm using python unittest in order to test some other external application but it takes too much time to run the test one by one.

我想知道如何利用多核的功能来加快此过程. 我可以调整unittest来并行执行测试吗?怎么样?

I would like to know how can I speedup this process by using the power of multi-cores. Can I tweak unittest to execute tests in parallel? How?

此问题无法实现python GIL限制,因为实际上不是python代码需要时间,而是我目前通过os.system()执行的外部应用程序.

This question is not able python GIL limitation because in fact not the python code takes time but the external application that I execute, currently via os.system().

推荐答案

如果您的测试不太复杂,则可以使用支持分布式测试.如果您未在Windows上运行,则鼻子也可能适用你.

If your tests are not too involved, you may be able to run them using py.test which has support for distributed testing. If you are not running on Windows, then nose might also work for you.

这篇关于如何加快muticore机器上的python unittest?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆