Skip to content

Commit 2b3d69d

Browse files
authored
Merge pull request #4865 from blueyed/revisit-cov-new
ci: revisit coverage reporting
2 parents bd2c9be + 8481e43 commit 2b3d69d

File tree

3 files changed

+84
-52
lines changed

3 files changed

+84
-52
lines changed

.travis.yml

Lines changed: 57 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -10,45 +10,23 @@ python:
1010
- '3.7'
1111
install:
1212
- python -m pip install --upgrade --pre tox
13-
env:
14-
matrix:
15-
- TOXENV=py27 PYTEST_COVERAGE=1
16-
# Specialized factors for py27.
17-
- TOXENV=py27-nobyte-numpy-xdist PYTEST_COVERAGE=1
18-
- TOXENV=py27-pluggymaster-xdist
19-
# Specialized factors for py37.
20-
- TOXENV=py37-pexpect,py37-trial
21-
- TOXENV=py37-pluggymaster-xdist
22-
- TOXENV=py37-freeze
23-
24-
matrix:
25-
allow_failures:
26-
- python: '3.8-dev'
27-
env: TOXENV=py38-xdist
2813

2914
jobs:
3015
include:
31-
# Coverage tracking is slow with pypy, skip it.
32-
- env: TOXENV=pypy-xdist
33-
python: 'pypy2.7-6.0'
34-
- env: TOXENV=pypy3-xdist
35-
python: 'pypy3.5-6.0'
36-
37-
- env: TOXENV=py34-xdist
38-
python: '3.4'
39-
- env: TOXENV=py35-xdist
40-
python: '3.5'
41-
- env: TOXENV=py36-xdist
42-
python: '3.6'
43-
- env: TOXENV=py37
16+
# OSX tests - first (in test stage), since they are the slower ones.
4417
- &test-macos
18+
# NOTE: (tests with) pexpect appear to be buggy on Travis,
19+
# at least with coverage.
20+
# Log: https://travis-ci.org/pytest-dev/pytest/jobs/500358864
4521
os: osx
4622
osx_image: xcode10.1
4723
language: generic
24+
# Coverage for:
25+
# - py2 with symlink in test_cmdline_python_package_symlink.
26+
env: TOXENV=py27-xdist PYTEST_COVERAGE=1
4827
before_install:
4928
- python -V
5029
- test $(python -c 'import sys; print("%d%d" % sys.version_info[0:2])') = 27
51-
env: TOXENV=py27-xdist
5230
- <<: *test-macos
5331
env: TOXENV=py37-xdist
5432
before_install:
@@ -58,16 +36,56 @@ jobs:
5836
- python -V
5937
- test $(python -c 'import sys; print("%d%d" % sys.version_info[0:2])') = 37
6038

39+
# Full run of latest (major) supported versions, without xdist.
40+
- env: TOXENV=py27
41+
python: '2.7'
42+
- env: TOXENV=py37
43+
python: '3.7'
44+
45+
# Coverage tracking is slow with pypy, skip it.
46+
- env: TOXENV=pypy-xdist
47+
python: 'pypy2.7-6.0'
48+
- env: TOXENV=pypy3-xdist
49+
python: 'pypy3.5-6.0'
50+
51+
- env: TOXENV=py34-xdist
52+
python: '3.4'
53+
- env: TOXENV=py35-xdist
54+
python: '3.5'
55+
56+
# Coverage for:
57+
# - pytester's LsofFdLeakChecker
58+
# - TestArgComplete (linux only)
59+
# - numpy
60+
- env: TOXENV=py37-lsof-numpy-xdist PYTEST_COVERAGE=1
61+
62+
# Specialized factors for py27.
63+
- env: TOXENV=py27-nobyte-numpy-xdist
64+
python: '2.7'
65+
- env: TOXENV=py27-pluggymaster-xdist
66+
python: '2.7'
67+
68+
# Specialized factors for py37.
69+
# Coverage for:
70+
# - test_sys_breakpoint_interception (via pexpect).
71+
- env: TOXENV=py37-pexpect,py37-trial PYTEST_COVERAGE=1
72+
- env: TOXENV=py37-pluggymaster-xdist
73+
- env: TOXENV=py37-freeze
74+
6175
# Jobs only run via Travis cron jobs (currently daily).
6276
- env: TOXENV=py38-xdist
6377
python: '3.8-dev'
6478
if: type = cron
6579

6680
- stage: baseline
67-
env: TOXENV=py27-pexpect,py27-trial
68-
- env: TOXENV=py37-lsof-numpy-xdist PYTEST_COVERAGE=1
69-
- env: TOXENV=linting,docs,doctesting
70-
python: '3.7'
81+
# Coverage for:
82+
# - _pytest.unittest._handle_skip (via pexpect).
83+
env: TOXENV=py27-pexpect,py27-trial PYTEST_COVERAGE=1
84+
python: '2.7'
85+
# Use py36 here for faster baseline.
86+
- env: TOXENV=py36-xdist
87+
python: '3.6'
88+
- env: TOXENV=linting,docs,doctesting PYTEST_COVERAGE=1
7189

7290
- stage: deploy
7391
python: '3.6'
@@ -84,6 +102,11 @@ jobs:
84102
tags: true
85103
repo: pytest-dev/pytest
86104

105+
matrix:
106+
allow_failures:
107+
- python: '3.8-dev'
108+
env: TOXENV=py38-xdist
109+
87110
before_script:
88111
- |
89112
# Do not (re-)upload coverage with cron runs.
@@ -109,7 +132,7 @@ after_success:
109132
coverage combine
110133
coverage xml
111134
coverage report -m
112-
bash <(curl -s https://codecov.io/bash) -Z -X gcov -X coveragepy -X search -X xcode -X gcovout -X fix -f coverage.xml -n $TOXENV
135+
bash <(curl -s https://codecov.io/bash) -Z -X gcov -X coveragepy -X search -X xcode -X gcovout -X fix -f coverage.xml -n $TOXENV-$TRAVIS_OS_NAME
113136
fi
114137
115138
notifications:

azure-pipelines.yml

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,28 @@ jobs:
2020
py27:
2121
python.version: '2.7'
2222
tox.env: 'py27'
23-
PYTEST_COVERAGE: '1'
24-
py27-nobyte-numpy-xdist:
23+
py27-nobyte-lsof-numpy:
2524
python.version: '2.7'
26-
tox.env: 'py27-nobyte-numpy-xdist'
25+
tox.env: 'py27-lsof-nobyte-numpy'
26+
# Coverage for:
27+
# - test_supports_breakpoint_module_global
28+
# - test_terminal_reporter_writer_attr (without xdist)
29+
# - "if write" branch in _pytest.assertion.rewrite
30+
# - numpy
31+
# - pytester's LsofFdLeakChecker (being skipped)
2732
PYTEST_COVERAGE: '1'
2833
py27-trial:
2934
python.version: '2.7'
3035
tox.env: 'py27-trial'
3136
python.needs_vc: True
32-
PYTEST_COVERAGE: '1'
3337
py27-pluggymaster-xdist:
3438
python.version: '2.7'
3539
tox.env: 'py27-pluggymaster-xdist'
40+
# Coverage for:
41+
# - except-IOError in _attempt_to_close_capture_file for py2.
42+
# Also seen with py27-nobyte (using xdist), and py27-xdist.
43+
# But no exception with py27-pexpect,py27-trial,py27-numpy.
44+
PYTEST_COVERAGE: '1'
3645
pypy:
3746
python.version: 'pypy'
3847
tox.env: 'pypy'
@@ -42,33 +51,34 @@ jobs:
4251
# python.version: 'pypy3'
4352
# tox.env: 'pypy3'
4453
# python.exe: 'pypy3'
45-
py34:
54+
py34-xdist:
4655
python.version: '3.4'
47-
tox.env: 'py34'
56+
tox.env: 'py34-xdist'
57+
# Coverage for:
58+
# - _pytest.compat._bytes_to_ascii
4859
PYTEST_COVERAGE: '1'
49-
py35:
60+
py35-xdist:
5061
python.version: '3.5'
51-
tox.env: 'py35'
62+
tox.env: 'py35-xdist'
63+
# Coverage for:
64+
# - test_supports_breakpoint_module_global
5265
PYTEST_COVERAGE: '1'
53-
py36:
66+
py36-xdist:
5467
python.version: '3.6'
55-
tox.env: 'py36'
56-
PYTEST_COVERAGE: '1'
68+
tox.env: 'py36-xdist'
5769
py37:
5870
python.version: '3.7'
5971
tox.env: 'py37'
72+
# Coverage for:
73+
# - _py36_windowsconsoleio_workaround (with py36+)
74+
# - test_request_garbage (no xdist)
6075
PYTEST_COVERAGE: '1'
6176
py37-linting/docs/doctesting:
6277
python.version: '3.7'
6378
tox.env: 'linting,docs,doctesting'
64-
py37-xdist:
65-
python.version: '3.7'
66-
tox.env: 'py37-xdist'
67-
PYTEST_COVERAGE: '1'
6879
py37-trial/numpy:
6980
python.version: '3.7'
7081
tox.env: 'py37-trial,py37-numpy'
71-
PYTEST_COVERAGE: '1'
7282
py37-pluggymaster-xdist:
7383
python.version: '3.7'
7484
tox.env: 'py37-pluggymaster-xdist'

testing/test_assertrewrite.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,8 +1313,7 @@ def test_cwd_changed(self, testdir, monkeypatch):
13131313
# always (previously triggered via xdist only).
13141314
# Ref: https://github.com/pytest-dev/py/pull/207
13151315
monkeypatch.setattr(sys, "path", [""] + sys.path)
1316-
if "pathlib" in sys.modules:
1317-
del sys.modules["pathlib"]
1316+
monkeypatch.delitem(sys.modules, "pathlib", raising=False)
13181317

13191318
testdir.makepyfile(
13201319
**{

0 commit comments

Comments
 (0)