如何使用鼻子测试将python脚本作为测试套件运行(一起运行一组测试)? [英] How to run python scripts as test suites (running a set of tests together) using nose tests?

查看:99
本文介绍了如何使用鼻子测试将python脚本作为测试套件运行(一起运行一组测试)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有大约50个Python自动脚本,我想将它们作为测试套件分开-每个大约5个,意味着10个套件.如何使用鼻子测试实现它?

I have a about 50 automated scripts in Python and I would like to separate them as test suites - approx 5 in each meaning 10 suites. How do I achieve it using nosetests?

推荐答案

仅使用以下方法:

> nosetests script1.py script2.py script3.py script4.py script5.py
> nosetests script3.py script4.py script5.py script6.py script7.py
> ...

如果将西服整理到文件夹中,则可以一次运行文件夹中的所有测试. 或者,您可以使用 attrib 插件并将单个测试标记为@attr(suit='suit1')的特定套件,并像这样运行它们:

If you organize your suits into folders you can run all tests in a folder in a single run. Alternatively, you can use attrib plugin and mark individual tests as members of a particular suite with @attr(suit='suit1') and run them like this:

> nosetests -a suit='suit1'

这篇关于如何使用鼻子测试将python脚本作为测试套件运行(一起运行一组测试)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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