【问题标题】:how to command variables values from conftest.py to pytest in cmd.exe如何在 cmd.exe 中将变量值从 conftest.py 命令到 pytest
【发布时间】:2021-06-23 07:11:00
【问题描述】:

在 bash "env" 和 terminalX "env -S" 工作,在 cmd "env" 不是内部或外部命令、可执行程序或批处理文件。

例如:

在 Linux 上:(.venv) ~ rootdir> $ env "browser.config.browser_name = firefox" pytest tests / file.py

在 MacOS 上:(.venv) ~/rootdir> env -S "browser.config.browser_name = firefox" pytest tests / file.py

但是在 Win: (.venv) ~/rootdir> ...?... "browser.config.browser_name = firefox" pytest tests / file.py

【问题讨论】:

    标签: python cmd pytest


    【解决方案1】:

    好的,现在我明白了。那么请看答案List all environment variables from the command line

    【讨论】:

    • 感谢您的回答。我的意思是,用什么来替换 Windows 命令行中的命令 env 因为 cmd.exe 说 env 不是内部或外部命令、可执行程序或批处理文件。
    • 例如,在 bash 命令 env 中,将 conftest.py 中的“variable=values”传递给 pytest。在 cmd.exe 中没有。
    猜你喜欢
    • 1970-01-01
    • 2020-09-08
    • 2021-10-01
    • 1970-01-01
    • 2011-04-20
    • 1970-01-01
    • 1970-01-01
    • 2022-06-30
    • 1970-01-01
    相关资源
    最近更新 更多