Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a7a8ec8

Browse files
committed
Run coverage only when activated
Run one of the jobs without multiprocesses and run coverage with this. The covarage plugin does not work well with multiprocessing
1 parent 48b9250 commit a7a8ec8

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

.travis.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ env:
2929
- PANDAS=
3030
- NPROC=2
3131
- TEST_ARGS=--no-pep8
32+
- NOSE_ARGS="--processes=$NPROC --process-timeout=300"
3233

3334
language: python
3435

@@ -38,7 +39,7 @@ matrix:
3839
env: MOCK=mock NUMPY=numpy==1.6
3940
- python: 3.4
4041
- python: 3.5
41-
env: PANDAS=pandas
42+
env: PANDAS=pandas NOSE_ARGS=--with-coverage
4243
- python: 3.5
4344
env: TEST_ARGS=--pep8
4445
- python: 2.7
@@ -102,7 +103,7 @@ script:
102103
- |
103104
if [[ $BUILD_DOCS == false ]]; then
104105
export MPL_REPO_DIR=$PWD # needed for pep8-conformance test of the examples
105-
gdb -return-child-result -batch -ex r -ex bt --args python tests.py --processes=$NPROC --process-timeout=300 $TEST_ARGS
106+
gdb -return-child-result -batch -ex r -ex bt --args python tests.py $NOSE_ARGS $TEST_ARGS
106107
else
107108
cd doc
108109
python make.py html --small --warningsaserrors
@@ -163,8 +164,6 @@ after_success:
163164
fi
164165
fi
165166
fi
166-
if [[ $BUILD_DOCS == false && $TEST_ARGS != "--pep8" ]]; then
167-
# account for us running the test out-of-repo and coveralls expects in-repo
168-
# tests
167+
if [[ $NOSE_ARGS="--with-coverage" ]]; then
169168
coveralls
170169
fi

lib/matplotlib/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,6 +1528,11 @@ def _get_extra_test_plugins():
15281528

15291529
return [KnownFailure, attrib.Plugin]
15301530

1531+
def _get_nose_env():
1532+
env = {'NOSE_COVER_PACKAGE': 'matplotlib',
1533+
'NOSE_COVER_HTML': 1,
1534+
'NOSE_COVER_NO_PRINT': 1}
1535+
return env
15311536

15321537
def test(verbosity=1):
15331538
"""run the matplotlib test suite"""

tests.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@
2323
def run(extra_args):
2424
from nose.plugins import multiprocess
2525

26-
env = {"NOSE_WITH_COVERAGE": 1,
27-
'NOSE_COVER_PACKAGE': 'matplotlib',
28-
'NOSE_COVER_HTML': 1,
29-
'NOSE_COVER_NO_PRINT': 1}
26+
env = _get_nose_env()
3027

3128
matplotlib._init_tests()
3229

0 commit comments

Comments
 (0)