如何在groovy脚本中编写pytest命令

时间:2021-07-28 05:45:17

标签: groovy pytest jenkins-groovy groovy-console

你好,我怀疑如何在 groovy 脚本中编写 pytest 命令 下面是我的 pytest 命令代码

if [some condition]
    pytest test_try.py 
else [some condition]
    pytest test_try1.py

我想将此代码转换为我尝试的 groovy 脚本,但我不知道如何在 groovy 中编写此代码,任何人都可以帮助我

1 个答案:

答案 0 :(得分:0)

类似的东西。记住python文件的路径。

if (some condition) {
    "pytest test_try.py".execute()
}
else if (some condition) {
    "pytest test_try1.py".execute()
}
相关问题