Is it possible to run py.test
with different versions of python without plugins (like xdist
) or tox
?
To run Pytest inside your virtual environment, first install it using python -m pip install pytest and then run python -m pytest .
pytest requires: Python 3.7+ or PyPy3.
Yes, you should be able to switch between python versions. As a standard, it is recommended to use the python3 command or python3. 7 to select a specific version. The py.exe launcher will automatically select the most recent version of Python you've installed.
As most Python packages, pytest is available on PyPI. You can install it in a virtual environment using pip : Windows. Linux + macOS.
The simplest way to do it is by running the pytest module directly with -m
, for example:
python2.6 -m 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With