Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pythonPackages.cartopy: fix tests for python2.7 using xvfb #60948

Merged
merged 1 commit into from May 7, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 9 additions & 4 deletions 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 {
Expand All @@ -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"
'';
Expand Down