我可以使用Tox来测试两个并行开发的软件包吗?

时间:2018-11-02 19:12:39

标签: python testing pytest tox

我在同一个仓库中有两个Python软件包-一个是自动生成的低级REST客户端(来自openapi-generator),另一个是使用这些低级方法实现更高级别目标的包装器。 / p>

当我要生成的API定义发生更改时,我经常必须对包装器进行相应的更改。因此,当我运行测试时,需要从工作目录中获取两个软件包的版本。例如,我可以这样做:

virtualenv env
source env/bin/activate
pip install -e autogen_client
pip install -e wrapper
py.test wrapper/tests/

是否有办法让toxvirtualenvpip混为一谈?就像您可以在deps字段中提供相对路径一样吗?还是我的用例很怪异,我只需要自己做?

1 个答案:

答案 0 :(得分:0)

事实证明,是的,您可以使毒物像这样

[tox]
envlist = py35,py36
skipsdist = True  # since there's no top-level package

[testenv]
deps =
    -eautogen_client
    -ewrapper
    pytest

commands =
    py.test wrapper/tests/

很好!