【python3部分】
Centos7 服务器默认安装有python2.7,后面运维帮再装了个python3.6,【如果没装,可以参照这个方法教程:https://blog.csdn.net/weixin_46043193/article/details/112993595】
【pytest部分】
在对pytest进行软链接设置时【参照教程:https://blog.csdn.net/weixin_46043193/article/details/112998885】,由于手快完全照着教程敲,导到目标目录弄错【本地实际地址是:/usr/local/python/bin/pytest,敲成: /usr/local/python3/bin/pytest,如下图(红色且闪烁)】,最终导致运行pytest时,提示命令找不到:但是用python3 -m pytest能访问
解决过程:
1、尝试过用rm -rf 【软链接地址】 删除,但是不成功,切换到软链接地址还能看到pytest存在;
2、后面试着用 ln -sf 【新目标目录】 【软链接地址】修改软链接,再运行pytest,成功了!
【软链接设置教程:https://blog.csdn.net/xhx94/article/details/98865598】
再 ll 查看 /usr/bin 目录,发现pytest指向的路径不再是红色。
再输入pytest --version 能正常查看版本号
【allure部分】
开始的时候是参照这个教程中allure部分进行设置,【https://blog.csdn.net/baozi_xiaoge/article/details/103418891】,但是后用sudo su 切换到root用户后,运行allure --version 会提示找不到命令;需要重新加载一下配置文件source /etc/profile,allure --version 命令才可以正常运行!
解决过程:
1、根据pytest的经验,设置一个软链接 ln -s /usr/local/allure-2.13.8/bin/allure /usr/bin/allure
现在用什么帐户都可以正常执行 allure 命令了!
【allure教程可参照:https://blog.csdn.net/u012799877/article/details/105398081】