about summary refs log tree commit diff
diff options
context:
space:
mode:
authorworldofpeace <worldofpeace@users.noreply.github.com>2019-05-07 15:38:11 -0400
committerGitHub <noreply@github.com>2019-05-07 15:38:11 -0400
commitd61543ad0ac4b5aa594384dbb8b440d042985b55 (patch)
tree2de5958aa2c07475c9e9b988fd19c3da73301fa2
parent037c15654a08061f15b25a48db493534b2779099 (diff)
parentcb0028b44974f661d6e2699209ab7045cd6349ab (diff)
downloadnixlib-d61543ad0ac4b5aa594384dbb8b440d042985b55.tar
nixlib-d61543ad0ac4b5aa594384dbb8b440d042985b55.tar.gz
nixlib-d61543ad0ac4b5aa594384dbb8b440d042985b55.tar.bz2
nixlib-d61543ad0ac4b5aa594384dbb8b440d042985b55.tar.lz
nixlib-d61543ad0ac4b5aa594384dbb8b440d042985b55.tar.xz
nixlib-d61543ad0ac4b5aa594384dbb8b440d042985b55.tar.zst
nixlib-d61543ad0ac4b5aa594384dbb8b440d042985b55.zip
Merge pull request #60948 from risicle/ris-cartopy-fix
pythonPackages.cartopy: fix tests for python2.7 using xvfb
-rw-r--r--pkgs/development/python-modules/cartopy/default.nix13
1 files changed, 9 insertions, 4 deletions
diff --git a/pkgs/development/python-modules/cartopy/default.nix b/pkgs/development/python-modules/cartopy/default.nix
index 3fc4c3e84ed4..28148450f076 100644
--- a/pkgs/development/python-modules/cartopy/default.nix
+++ b/pkgs/development/python-modules/cartopy/default.nix
@@ -1,8 +1,9 @@
 { buildPythonPackage, lib, fetchPypi
 , pytest, filelock, mock, pep8
-, cython, isPy37, glibcLocales
+, cython, isPy27, isPy37, glibcLocales
 , six, pyshp, shapely, geos, proj, numpy
 , gdal, pillow, matplotlib, pyepsg, pykdtree, scipy, owslib, fiona
+, xvfb_run
 }:
 
 buildPythonPackage rec {
@@ -17,10 +18,14 @@ buildPythonPackage rec {
 
   checkInputs = [ filelock mock pytest pep8 ];
 
-  # several tests require network connectivity: we disable them
-  checkPhase = ''
+  # several tests require network connectivity: we disable them.
+  # also py2.7's tk is over-eager in trying to open an x display,
+  # so give it xvfb
+  checkPhase = let
+    maybeXvfbRun = lib.optionalString isPy27 "${xvfb_run}/bin/xvfb-run";
+  in ''
     export HOME=$(mktemp -d)
-    pytest --pyargs cartopy \
+    ${maybeXvfbRun} pytest --pyargs cartopy \
       -m "not network and not natural_earth" \
       -k "not test_nightshade_image"
   '';