git.iko.soy/typeable/nixpkgs
on master help sign in
pythonPackages.worldengine: fix tests by moving nose to checkInputs

also only perform nosetests in py<3.5

commit4a72ca113584502cc92e33470e70797945e342b9 authorRobert Scott <code@humanleg.org.uk> dateSun 5 May 2019, 16:14 (8 years ago) parentc910fe9
1 file changed+5−4
pkgs/development/python-modules/worldengine/default.nix+5−4
pkgs/development/python-modules/worldengine/default.nix+5−4
@@ -1,5 +1,6 @@
11{ stdenv
22, buildPythonPackage
3+, pythonOlder
34, fetchFromGitHub
45, nose
56, noise
@@ -33,7 +34,6 @@ buildPythonPackage rec {
3334 ln -s ${src-data} worldengine-data
3435 '';
3536
36− buildInputs = [ nose ];
3737 propagatedBuildInputs = [ noise numpy pyplatec protobuf purepng h5py gdal ];
3838
3939 prePatch = ''
@@ -46,9 +46,10 @@ buildPythonPackage rec {
4646 --replace 'PyPlatec==1.4.0' 'PyPlatec' \
4747 '';
4848
49− doCheck = true;
50−
51− postCheck = ''
49+ # with python<3.5, unittest fails to discover tests because of their filenames
50+ # so nose is used instead.
51+ checkInputs = stdenv.lib.optional (pythonOlder "3.5") [ nose ];
52+ postCheck = stdenv.lib.optionalString (pythonOlder "3.5") ''
5253 nosetests tests
5354 '';
5455