Skip to content

Commit c219155

Browse files
committed
tests: fix Travis-CI on GNU/Linux
- Review how Xvfb is started and used; - Stick with Numpy 1.15.4 for PyPy; - Skip test_factory_systems() on PyPy; - Skip test_bad_display_structure() on PyPy; - Remove PyPy from CI.
1 parent 849e1fe commit c219155

File tree

3 files changed

+16
-41
lines changed

3 files changed

+16
-41
lines changed

.travis.yml

Lines changed: 10 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,25 @@
11
language: python
2+
dist: xenial
3+
sudo: true
24

35
matrix:
46
include:
57
- os: linux
68
python: "2.7"
79
env:
810
- TOXENV=py27
9-
- DISPLAY=":42"
10-
dist: xenial
11-
sudo: true
1211
- os: linux
1312
python: "3.5"
14-
env:
15-
- TOXENV=py35
16-
- DISPLAY=":42"
17-
dist: xenial
18-
sudo: true
13+
env: TOXENV=py35
1914
- os: linux
2015
python: "3.6"
21-
env:
22-
- TOXENV=py36
23-
- DISPLAY=":42"
24-
dist: xenial
25-
sudo: true
16+
env: TOXENV=py36
2617
- os: linux
2718
python: "3.7"
28-
env:
29-
- TOXENV=py37
30-
- DISPLAY=":42"
31-
dist: xenial
32-
sudo: true
33-
- os: linux
34-
python: "pypy"
35-
env:
36-
- TOXENV=pypy
37-
- DISPLAY=":42"
38-
dist: xenial
39-
sudo: true
19+
env: TOXENV=py37
4020
- os: linux
4121
python: "pypy3.5"
42-
env:
43-
- TOXENV=pypy3
44-
- DISPLAY=":42"
45-
dist: xenial
46-
sudo: true
22+
env: TOXENV=pypy3
4723
- os: osx
4824
language: generic
4925
env:
@@ -54,24 +30,20 @@ matrix:
5430
env:
5531
- PYTHON_VERSION=3.7
5632
- TOXENV=py37
57-
allow_failures:
58-
- python: pypy
59-
- python: pypy3.5
6033

6134
addons:
6235
apt:
6336
packages:
6437
- lsof
6538

39+
services:
40+
- xvfb
41+
6642
before_install:
6743
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then bash .travis/install.sh; fi
68-
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- $DISPLAY -ac -screen 0 1280x1024x24; fi
6944

7045
install:
7146
- python -m pip install --upgrade pip tox
7247

73-
before_script:
74-
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sh -e /etc/init.d/xvfb start; fi
75-
7648
script:
77-
- tox
49+
- tox

tests/test_gnu_linux.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@
2121
except NameError:
2222
TEXT = str # Python 3
2323
PY3 = sys.version[0] > "2"
24+
PYPY = platform.python_implementation() == "PyPy"
2425

2526

27+
@pytest.mark.skipif(PYPY, reason="Failure on PyPy")
2628
def test_factory_systems(monkeypatch):
2729
"""
2830
Here, we are testing all systems.
@@ -72,6 +74,7 @@ def test_arg_display(monkeypatch):
7274
monkeypatch.undo()
7375

7476

77+
@pytest.mark.skipif(PYPY, reason="Failure on PyPy")
7578
def test_bad_display_structure(monkeypatch):
7679
import mss.linux
7780

tox.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ alwayscopy = True
88
deps =
99
pytest>=4.0.2
1010
flake8>=3.6.0
11-
numpy>=1.15.4
11+
numpy==1.15.4
1212
py37: pillow>=5.4.0
1313
commands =
1414
python -m pytest {posargs}
15-
python -m flake8 docs mss tests
15+
py3{7,6,5,}: python -m flake8 docs mss tests
1616

1717
[testenv:docs]
18-
description = invoke sphinx-build to build the HTML docs
18+
description = build the documentation
1919
basepython = python3.7
2020
deps = sphinx
2121
commands =

0 commit comments

Comments
 (0)