【问题标题】:How to excecute allure inside python file?如何在python文件中执行诱惑?
【发布时间】:2021-07-06 03:51:07
【问题描述】:

我有一个问题,

  • 我在使用时无法从 python 中调用 allure

    os.system("allure" + "serve" + 'link_path_report') 或者 subprocess.run(['allure serve link_path_report'])

cmd show "'allure' 未被识别为内部或外部命令, 可运行的程序或批处理文件。”

但是当我手动输入命令到 cmd 时它工作正常

【问题讨论】:

  • 使用诱惑的完整路径。有点像 /usr/bin/allure。

标签: python pytest allure


【解决方案1】:

在这种情况下,我使用 subprocess 在 power shell 中调用 allure 命令

subprocess.run([r'powershell.exe', r'allure ' + 'serve ' + './Reports'])

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-05-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-05-16
    相关资源
    最近更新 更多