Jac*_*icz 19 python unit-testing centos nose
我们有CentOS和古老的Python 2.4解释器.
但我们想用更新的2.5/2.6语法编写测试.
假设我们安装了第二个Python解释器(例如python2.6)有没有办法运行'nosetests'hell命令并告诉它使用特定的python解释器而不是默认的?
Tho*_*s K 21
nosetests文件是用Python编写的,所以它应该只是在新版本中运行它.找到文件的位置:
which nosetests
Run Code Online (Sandbox Code Playgroud)
然后:
python2.6 /usr/bin/nosetests
Run Code Online (Sandbox Code Playgroud)
调整名称和路径以匹配您的系统.我没有测试过,但这应该可行.