3 ms·
This, absolutely. If you're running tests for building a package, here's an entire "tox.ini" file for running all your tests on multiple python versions: [t
by Izkata 4y ago
This, absolutely. If you're running tests for building a package, here's an entire "tox.ini" file for running all your tests on multiple python versions:
[tox]
envlist = py27,py36,py38
[testenv]
deps =
pytest # Install extra packages for testing separate from what's in setup.py or whatever
commands =
pytest # Whatever test command your project uses
That's really it for bare minimum. If you have pytest configuration, they can also go into tox.ini under a [pytest] section to keep them in the same place.
Instead of installing tox globally you can even install it to a separate virtualenv, activate it, then run "tox". It figures out the right thing to do.
If you're not building a package:
[tox]
envlist = py27,py36,py38
skipsdist = True # Don't attempt to build a package / pull from setup.py
[testenv]
deps =
-r requirements.txt # Pull in project requirements
pytest
commands =
pytest