如何在TravisCI中使用python-3.6.7

如何在TravisCI中使用python-3.6.7,python,continuous-integration,travis-ci,Python,Continuous Integration,Travis Ci,我有一个使用TravisCI的Python项目,但是我的pytest命令在Travis上失败,并在本地机器上传递。我想原因是我在本地机器中使用了Python-3.6.7,而Travis使用的是Python-3.6.3 我的.travis.yml文件: language: python python: - "3.6" - "3.6-dev" # 3.6 development branch # command to install dependencies before_install:

我有一个使用TravisCI的Python项目,但是我的
pytest
命令在Travis上失败,并在本地机器上传递。我想原因是我在本地机器中使用了Python-3.6.7,而Travis使用的是Python-3.6.3
我的
.travis.yml
文件:

language: python
python:
  - "3.6"
  - "3.6-dev"  # 3.6 development branch
# command to install dependencies
before_install:
  # install python 3.6.7
install:
  - pip install -r requirements.txt
  - pip install -U pytest
# command to run tests
script:
  - 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安装-U python
不起作用。

我在travis文件中使用了
dist:xenial
,比如:

dist: xenial  
python:
  - "3.6"  
 ----  so on ---  

默认情况下,它与Python 3.6.7一起提供。:)

您是否尝试过
“3.6.7”
?@Sraw是的,也不起作用。