pythonPackages.worldengine: fix tests by moving nose to checkInputs

also only perform nosetests in py<3.5
This commit is contained in:
Robert Scott 2019-05-05 16:14:24 +01:00
parent c910fe9d29
commit 4a72ca1135

View File

@ -1,5 +1,6 @@
{ stdenv { stdenv
, buildPythonPackage , buildPythonPackage
, pythonOlder
, fetchFromGitHub , fetchFromGitHub
, nose , nose
, noise , noise
@ -33,7 +34,6 @@ buildPythonPackage rec {
ln -s ${src-data} worldengine-data ln -s ${src-data} worldengine-data
''; '';
buildInputs = [ nose ];
propagatedBuildInputs = [ noise numpy pyplatec protobuf purepng h5py gdal ]; propagatedBuildInputs = [ noise numpy pyplatec protobuf purepng h5py gdal ];
prePatch = '' prePatch = ''
@ -46,9 +46,10 @@ buildPythonPackage rec {
--replace 'PyPlatec==1.4.0' 'PyPlatec' \ --replace 'PyPlatec==1.4.0' 'PyPlatec' \
''; '';
doCheck = true; # with python<3.5, unittest fails to discover tests because of their filenames
# so nose is used instead.
postCheck = '' checkInputs = stdenv.lib.optional (pythonOlder "3.5") [ nose ];
postCheck = stdenv.lib.optionalString (pythonOlder "3.5") ''
nosetests tests nosetests tests
''; '';