【问题标题】:List inheritance in tox.ini files?在 tox.ini 文件中列出继承?
【发布时间】:2017-04-07 16:27:53
【问题描述】:

我有一个 tox.ini 文件,如下所示:

[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

py27 和 py33 都继承自主要的 [testenv] 部分。 有没有一种方法我不必在继承时指定整个列表,而只需追加,可能是这样的:

deps += mock 

【问题讨论】:

    标签: python inheritance ini tox


    【解决方案1】:

    变体 №1:

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

    变体 №2:

    [testenv]
    …
    deps =
        requests
        …
        isodate
        py27: mock
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-06-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多