4
4
# Commit where MPLLOCALFREETYPE introduced
5
5
LOCAL_FT_COMMIT=5ad9b15
6
6
7
+ # Test arguments
8
+ NPROC=2
9
+ PYTEST_ARGS=" -ra --maxfail=1 --timeout=300 --durations=25 -n $NPROC "
10
+
7
11
8
12
function pre_build {
9
13
# Any stuff that you need to do before you start building the wheels
@@ -54,10 +58,6 @@ function run_tests {
54
58
MPL_INSTALL_DIR=$( dirname $( python -c ' import matplotlib; print(matplotlib.__file__)' ) )
55
59
cp -r ${MPL_SRC_DIR} /lib/matplotlib/tests/baseline_images $MPL_INSTALL_DIR /tests
56
60
57
- # Patch test_image file to fix test order bug
58
- local patch_file=$( abspath ../patches/test_image.patch)
59
- (cd $MPL_INSTALL_DIR && patch -p0 < $patch_file )
60
-
61
61
if [ -z " $IS_OSX " ]; then
62
62
# Need fc-list for tests
63
63
sudo apt-get install fontconfig
@@ -69,16 +69,14 @@ function run_tests {
69
69
python -c " import matplotlib; print(matplotlib.__file__)"
70
70
python -c " from matplotlib import font_manager"
71
71
72
- echo " testing matplotlib using 1 process"
73
- # 1.5.x has pesky unicode error for sphinx extension test
74
- local mpl_version=$( python -c " import matplotlib; print(matplotlib.__version__)" )
75
- if [[ " $mpl_version " =~ 1\. ]]; then
76
- local extra_test_args=" -e TestTinyPages"
77
- else
78
- # See gh issue 7799
79
- local extra_test_args=" --recursionlimit=1500"
80
- fi
81
- python $MPL_SRC_DIR /tests.py -sv $extra_test_args
72
+ # Workaround for pytest-xdist flaky collection order
73
+ # https://github.com/pytest-dev/pytest/issues/920
74
+ # https://github.com/pytest-dev/pytest/issues/1075
75
+ export PYTHONHASHSEED=$( python -c ' import random; print(random.randint(1, 4294967295))' )
76
+ echo PYTHONHASHSEED=$PYTHONHASHSEED
77
+
78
+ echo " testing matplotlib using $NPROC process(es)"
79
+ py.test $PYTEST_ARGS $MPL_INSTALL_DIR $( dirname ${MPL_INSTALL_DIR} ) /mpl_toolkits
82
80
83
81
echo " Check import of tcl / tk"
84
82
MPLBACKEND=" tkagg" python -c ' import matplotlib.pyplot as plt; print(plt.get_backend())'
0 commit comments