@@ -1,8 +1,9 @@
11{ buildPythonPackage, lib, fetchPypi
22, pytest, filelock, mock, pep8
3−, cython, isPy37, glibcLocales
3+, cython, isPy27, isPy37, glibcLocales
44, six, pyshp, shapely, geos, proj, numpy
55, gdal, pillow, matplotlib, pyepsg, pykdtree, scipy, owslib, fiona
6+, xvfb_run
67}:
78
89buildPythonPackage rec {
@@ -17,10 +18,14 @@ buildPythonPackage rec {
1718
1819 checkInputs = [ filelock mock pytest pep8 ];
1920
20− # several tests require network connectivity: we disable them
21− checkPhase = ''
21+ # several tests require network connectivity: we disable them.
22+ # also py2.7's tk is over-eager in trying to open an x display,
23+ # so give it xvfb
24+ checkPhase = let
25+ maybeXvfbRun = lib.optionalString isPy27 "${xvfb_run}/bin/xvfb-run";
26+ in ''
2227 export HOME=$(mktemp -d)
23− pytest --pyargs cartopy \
28+ ${maybeXvfbRun} pytest --pyargs cartopy \
2429 -m "not network and not natural_earth" \
2530 -k "not test_nightshade_image"
2631 '';