Python 特拉维斯收集。。。命令";pytest“;以1退出

Python 特拉维斯收集。。。命令";pytest“;以1退出,python,pytest,travis-ci,Python,Pytest,Travis Ci,对于项目和travis配置: # see https://docs.travis-ci.com/user/languages/python/ language: python # python versions to be tested python: # - "2.7" # see https://github.com/WolfgangFahl/gremlin-python-tutorial/issues/7 - "3.7" # command to install dependenci

对于项目和travis配置:

# see https://docs.travis-ci.com/user/languages/python/
language: python
# python versions to be tested
python:
#  - "2.7" # see https://github.com/WolfgangFahl/gremlin-python-tutorial/issues/7
  - "3.7"
# command to install dependencies
install:
  - pip install -r requirements.txt
# command to run tests
script:
  - pytest
我收到错误消息:

collecting ... The command "pytest" exited with 1.
在特拉维斯的环境中。在当地,我得到:

============================== test session starts ==============================
platform darwin -- Python 3.7.4, pytest-5.2.1, py-1.8.0, pluggy-0.12.0
rootdir: /Users/wf/source/python/play-chess-with-a-webcam
collected 5 items                                                               

test_OpenCV_version.py .                                                  [ 20%]
test_Video.py ..                                                          [ 60%]
test_findBoard.py ..                                                      [100%]

=============================== 5 passed in 7.03s ===============================

错误的原因是什么?


我如何修复它?

错误的原因是什么? 测试有OpenCV GUI输出,无头的情况让我们来测试一下

我如何修复它? 将以下内容添加到.travis.yml

# allow gui output
services:
  - xvfb