【发布时间】:2014-09-21 08:07:39
【问题描述】:
我有一系列单元测试打算在两种情况下运行:
1) 在 buildbot 服务器上 2) 在开发者的家庭环境中
在我们的开发过程和 buildbot 服务器中,我们都使用 virtualenv。测试在开发人员环境中运行良好,但使用 buildbot 时,测试是从 virtualenv 中的 python 可执行文件运行的,而无需激活 virtualenv。
这适用于大多数测试,但有一些可以运行脚本,我希望它们使用 virtualenv 的 python 可执行文件运行脚本。有没有办法在测试本身中拉出当前 python 可执行文件的路径,从而以这种方式构建 shell 命令?
【问题讨论】:
-
糟糕,错误的欺骗。 The correct one
标签: python