python3Packages.pytest: remove unreproducible test artifacts from output

Running the tests produced some unreproducible artifacts from the
output directory. This cleans them up afterwards.
This commit is contained in:
Arnout Engelen 2020-12-28 20:15:40 +01:00
parent 84917aa00b
commit 63484ff09d
No known key found for this signature in database
GPG Key ID: 061107B0F74A6DAA

View File

@ -58,6 +58,12 @@ buildPythonPackage rec {
checkPhase = '' checkPhase = ''
runHook preCheck runHook preCheck
$out/bin/py.test -x testing/ -k "not test_collect_pyargs_with_testpaths" --ignore=testing/test_junitxml.py $out/bin/py.test -x testing/ -k "not test_collect_pyargs_with_testpaths" --ignore=testing/test_junitxml.py
# tests leave behind unreproducible pytest binaries in the output directory, remove:
find $out/lib -name "*-pytest-${version}.pyc" -delete
# specifically testing/test_assertion.py and testing/test_assertrewrite.py leave behind those:
find $out/lib -name "*opt-2.pyc" -delete
runHook postCheck runHook postCheck
''; '';