需要帮助!我有一份关于Gitlab ci的工作,它运行测试并重新运行失败的测试。如果没有失败的测试,退出代码5的作业就会失败,这意味着没有运行的测试。我发现有插件“pytest-定制_exit_code”,但我不知道如何正确使用它。我只需要添加命令'pytest --抑制-不测试-退出-代码‘到我的runner.sh?现在看起来是这样的:
#!/bin/sh
/usr/local/bin/pytest -m test
/usr/local/bin/pytest -m --last-failed --last-failed-no-failures none test
发布于 2022-11-18 12:59:09
这里的假设是,插件是首先使用
pip install pytest-custom_exit_code
在此之后,类似于选项pytest --suppress-no-test-exit-code
的命令应该可以工作。
如果使用像.pytest.ini这样的配置文件,则应该在其中添加以下行
[pytest]
addopts = --suppress-no-test-exit-code
https://stackoverflow.com/questions/73091711
复制相似问题