Python tox中的平台特定变量
我有一个Python tox中的平台特定变量,python,tox,Python,Tox,我有一个tox.ini可以在Linux/MacOS上运行,但不能在Windows上运行。相关部分如下所示 [testenv:report] commands = {envbindir}/command.py file.txt /dev/null 在Windows上失败,因为/dev/null不是文件。我需要将其替换为仅适用于Windows的num:。 我试着用 但我得到错误tox.exception.ConfigError:ConfigError:substitution key'nowh
tox.ini
可以在Linux/MacOS上运行,但不能在Windows上运行。相关部分如下所示
[testenv:report]
commands =
{envbindir}/command.py file.txt /dev/null
在Windows上失败,因为/dev/null
不是文件。我需要将其替换为仅适用于Windows的num:
。
我试着用
但我得到错误tox.exception.ConfigError:ConfigError:substitution key'nowhere'未找到
我还尝试使用环境变量
setenv =
posix: NOWHERE=/dev/null
win: NOWHERE=NUL
commands =
{envbindir}/command.py file.txt {env:NOWHERE}
它给出了错误:报告:无法解决的替换:'NOWHERE'。缺少或递归定义了环境变量。
tox版本3.12.1
setenv =
posix: NOWHERE=/dev/null
win: NOWHERE=NUL
commands =
{envbindir}/command.py file.txt {env:NOWHERE}