鼻子测试跳过带有多个测试的python中的某些测试

时间:2019-04-04 10:15:08

标签: shell command-line build pipeline nose

我想从构建或管道中跳过或排除某些测试。

我正在运行.net,它将在某个特定文件夹下运行所有​​测试。

假设大约有SignalR且我想跳过的nosetests -s -v *中-为此,我正在尝试

30 tests

5

但是他们两个都不适合我。

I am referring from here

nosetests -s -v * --exclude-test test_sometest.py test_somemoretest.py

任何帮助都会很棒!

2 个答案:

答案 0 :(得分:0)

将此参数添加到您的命令中:  --ignore-files="tests_to_exclude\.py"

答案 1 :(得分:0)

python -m pytest --cache-clear -v -x -r a --junit-xml=tests/engine_tests --junit-prefix=measure_tests *.py --deselect Test1\.py --deselect Test2\.py --deselect Test3\.py --deselect Test4\.py

我尝试了这个,对我有用。在此之前,您需要安装pytest

pip install pytest

通过键入将找到文档 pytest --help在终端下

here某处

相关问题