Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List inheritance in tox.ini files?

I have a tox.ini file, like this:

[testenv]
usedevelop=True
commands =
    py.test --quiet {posargs}
deps =
    requests
    pytest
    pytest-cov
    pytest-env
    oauthlib
    PyJWT
    python-dateutil
    pydispatcher
    isodate


[testenv:py27]
deps =
    mock
    requests
    pytest
    pytest-cov
    pytest-env
    oauthlib
    PyJWT
    python-dateutil
    pydispatcher
    isodate

[testenv:py33]
basepython = /opt/python3.3/bin/python3.3

Where both py27 and py33 inherit from the main [testenv] section. Is there a way where I don't have to specify an entire list on inheritance, but only append, maybe something like this:

deps += mock 
like image 335
Saša Kalaba Avatar asked Oct 15 '25 04:10

Saša Kalaba


1 Answers

Variant №1:

[testenv:py27]
deps =
    {[testenv]deps}
    mock

Variant №2:

[testenv]
…
deps =
    requests
    …
    isodate
    py27: mock
like image 133
phd Avatar answered Oct 16 '25 19:10

phd



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!