Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to I configure tox so it will run pytest coverage on a single environment instead of all?

I do have a complex tox.ini configuration with multiple environments for different versions of python.

I would like to know how to tell tox to run coverage only on the default python interpretor.

One of the problems is that the default python environment can be different from one platform to another.

I do have a wrapper script which calls tox -e py25,py26,docs where the -e arguments are the detected versions of python.

[tox]
     ...
[testenv:docs]
     ...
[testenv]
     commands=py.test --cov-report xml --cov scripts
     ...
[testenv:py26]
     ...
[testenv:py25]
     ...

Desired behaviour: run pytest with coverage for a single environment (this is supposed to run integrated with jenkins).

like image 660
sorin Avatar asked Dec 05 '12 17:12

sorin


1 Answers

I think you could use and include the [testenv:py] environment which uses the python interpreter with which tox is invoked itself. If you define the coverage-run there you should get what you want.

like image 86
hpk42 Avatar answered Sep 21 '22 17:09

hpk42