且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何针对不同版本的python运行py.test?

更新时间:2022-03-28 21:41:01

最简单的方法是使用 -m 直接运行 pytest 模块,例如:

The simplest way to do it is by running the pytest module directly with -m, for example:

python2.6 -m pytest

请注意,您必须为那个版本的 Python 安装 pytest.此外,您还需要安装用于那个版本 Python 的所有 pytest 插件.

Note that you have to have pytest installed for that version of Python. In addition, you need to install all pytest plugins that you are using for that version of Python too.