Skip to content

Commit 45c64e2

Browse files
authored
Merge pull request matplotlib#7468 from Kojoley/enable-pytest-xdist
TST: Enable pytest-xdist
2 parents 45e4a46 + cecf4a6 commit 45c64e2

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

.travis.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,10 @@ env:
4545
- NPROC=2
4646
- TEST_ARGS=--no-pep8
4747
- NOSE_ARGS="-j $NPROC"
48-
- PYTEST_ARGS="-ra --timeout=300 --durations=25 --cov-report= --cov=lib" # -n $NPROC
48+
- PYTEST_ARGS="-ra --timeout=300 --durations=25 --cov-report= --cov=lib -n $NPROC"
4949
- PYTHON_ARGS=
5050
- DELETE_FONT_CACHE=
5151
- USE_PYTEST=false
52-
#- PYTHONHASHSEED=0 # Workaround for pytest-xdist flaky colletion order
53-
# # https://github.com/pytest-dev/pytest/issues/920
54-
# # https://github.com/pytest-dev/pytest/issues/1075
5552

5653
matrix:
5754
include:
@@ -166,6 +163,12 @@ script:
166163
gdb -return-child-result -batch -ex r -ex bt --args python $PYTHON_ARGS tests.py $NOSE_ARGS $TEST_ARGS
167164
fi
168165
else
166+
# Workaround for pytest-xdist flaky colletion order
167+
# https://github.com/pytest-dev/pytest/issues/920
168+
# https://github.com/pytest-dev/pytest/issues/1075
169+
export PYTHONHASHSEED=$(shuf -i 1-4294967295 -n 1)
170+
echo PYTHONHASHSEED=$PYTHONHASHSEED
171+
169172
echo The following args are passed to pytest $PYTEST_ARGS
170173
py.test $PYTEST_ARGS $TEST_ARGS
171174
fi

0 commit comments

Comments
 (0)