我有一個使用 TravisCI 的 Python 項目,但我的pytest命令在 Travis 上失敗并在本地機器上傳遞。我認為原因是我在本地機器上使用了 Python-3.6.7,而 Travis 使用的是 Python -3.6.3我的.travis.yml文件:language: pythonpython: - "3.6" - "3.6-dev" # 3.6 development branch# command to install dependenciesbefore_install: # install python 3.6.7install: - pip install -r requirements.txt - pip install -U pytest# command to run testsscript: - pytest我的本地 pytest 日志:platform linux -- Python 3.6.7, pytest-4.0.2, py-1.7.0, pluggy-0.8.0# tests passed. 我的 travis pytest 日志:platform linux -- Python 3.6.3, pytest-4.0.2, py-1.7.0, pluggy-0.8.0 #tests failed.所以我假設使用 3.6.7 Python 版本將修復我的測試,有人可以幫忙嗎?我試過的:pip install -U python 不起作用。
3 回答
慕后森
TA貢獻1802條經驗 獲得超5個贊
我dist: xenial在我的 travis 文件中使用了這樣的:
dist: xenial
python:
- "3.6"
---- so on ---
它默認帶有 Python 3.6.7。:)
添加回答
舉報
0/150
提交
取消
