如何针对不同的 Python *patch* 版本测试库? [英] How to test a library against different Python *patch* versions?
问题描述
我正在编写一个库并想针对不同的 Python 补丁版本进行测试,例如 3.7.1、3.7.2 等
I'm writing a library and want to test against different Python patch versions, like 3.7.1, 3.7.2, etc
我已经使用 tox
很长时间了,但是,根据这个 answer,它并不真正支持这种用法.
I've been using tox
for a long time, however, according to this answer, it doesn't really support this kind of usage.
有什么建议吗?
推荐答案
对于 3.8.1 的检查之一(假设您的 python3.8 指向 3.8.2),您可以使用 发现标志
For a one of check against 3.8.1 (assuming your python3.8 points to 3.8.2) you can use the discover flag
tox --discover /path/to/python3.8.1 -e py38
如果你想定义一个总是使用 3.8.1 的环境,你可以通过定义一个新的 tox 环境并设置 basepython 作为 python3.8.1
.
If you want to define an environment that always uses 3.8.1 you can do that by defining a new tox environment and setting basepython as python3.8.1
.
[testenv:py381]
basepython = python3.8.1
[testenv:py382]
basepython = python3.8.2
这篇关于如何针对不同的 Python *patch* 版本测试库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!