我在 .travis.yml 中有以下内容:
language: python
python:
- "3.4"
- "3.5"
- "3.5-dev" # 3.5 development branch
- "3.6-dev" # 3.6 development branch
- "nightly" # currently points to 3.7-dev
# command to run tests
script: pytest
问题是在 python <= 3.5 中它是 py.test
而不是 pytest
。
如何告诉 travis 对“3.4”和“3.5”使用 py.test
?
最佳答案
找到了我的问题的答案。
将 script
部分更改为:
script:
- if [[ $TRAVIS_PYTHON_VERSION == 3.4 || $TRAVIS_PYTHON_VERSION == 3.5 ]]; then py.test;else pytest; fi
关于python - Travis CI 和 pytest 具有多个 python 版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41261590/