python313Packages.ruffus: fix tests (#404499)

This commit is contained in:
Vladimír Čunát
2025-05-13 15:28:39 +02:00
@@ -4,6 +4,7 @@
fetchFromGitHub,
hostname,
pytest,
pythonAtLeast,
lib,
stdenv,
}:
@@ -29,15 +30,21 @@ buildPythonPackage rec {
# tests very flaky & hang often on darwin
doCheck = !stdenv.hostPlatform.isDarwin;
# test files do indeed need to be executed separately
checkPhase = ''
pushd ruffus/test
rm test_with_logger.py # spawns 500 processes
for f in test_*.py ; do
HOME=$TMPDIR pytest -v --disable-warnings $f
done
popd
'';
checkPhase =
# https://docs.python.org/3/whatsnew/3.13.html#re
lib.optionalString (pythonAtLeast "3.13") ''
substituteInPlace ruffus/test/test_ruffus_utility.py \
--replace-fail re.error re.PatternError
''
# test files do indeed need to be executed separately
+ ''
pushd ruffus/test
rm test_with_logger.py # spawns 500 processes
for f in test_*.py ; do
HOME=$TMPDIR pytest -v --disable-warnings $f
done
popd
'';
pythonImportsCheck = [ "ruffus" ];
meta = with lib; {