在Tox运行测试命令之前,如何配置Tox以获取文件?
我尝试了显而易见的方法:
commands = source /path/to/my/setup.bash; ./mytestcommand但毒物检测只报告了ERROR: InvocationError: could not find executable 'source'
我知道Tox有一个setenv参数,但我想使用我的setup.bash,而不必将其内容复制并粘贴到我的tox.ini中。
发布于 2018-03-09 06:48:17
tox使用exec系统调用来运行命令,而不是外壳;当然,exec不知道如何运行source。您需要使用bash显式运行该命令,并且需要将bash列入白名单,以避免来自tox的警告。也就是说,您的tox.ini应该如下所示:
[testenv]
commands =
bash -c 'source /path/to/my/setup.bash; ./mytestcommand'
whitelist_externals =
bashhttps://stackoverflow.com/questions/49183537
复制相似问题