本文介绍了如何针对不同版本的python运行py.test?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在没有插件(如xdist)或tox的情况下使用不同版本的python运行py.test?

Is it possible to run py.test with different versions of python without plugins (like xdist) or tox?

推荐答案

最简单的方法是使用 -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.

这篇关于如何针对不同版本的python运行py.test?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 09:02
查看更多