How to run python scripts as test suites (running a set of tests together) using nose tests?

我是研究僧i 提交于 2019-12-11 09:39:08

问题


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?


回答1:


How about just using:

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

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'


来源:https://stackoverflow.com/questions/26742495/how-to-run-python-scripts-as-test-suites-running-a-set-of-tests-together-using

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!