about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pytest
diff options
context:
space:
mode:
authorArnout Engelen <arnout@bzzt.net>2020-12-28 20:15:40 +0100
committerArnout Engelen <arnout@bzzt.net>2020-12-28 22:01:09 +0100
commit63484ff09deb283664cb4d08dea18f49d994ff14 (patch)
treeb7aeb52fc4cc706a5a67efad807f42289b1ed462 /pkgs/development/python-modules/pytest
parent84917aa00bf23c88e5874c683abe05edb0ba4078 (diff)
python3Packages.pytest: remove unreproducible test artifacts from output
Running the tests produced some unreproducible artifacts from the
output directory. This cleans them up afterwards.
Diffstat (limited to 'pkgs/development/python-modules/pytest')
-rw-r--r--pkgs/development/python-modules/pytest/default.nix6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/pytest/default.nix b/pkgs/development/python-modules/pytest/default.nix
index 93282218871ab..e0648285810bd 100644
--- a/pkgs/development/python-modules/pytest/default.nix
+++ b/pkgs/development/python-modules/pytest/default.nix
@@ -58,6 +58,12 @@ buildPythonPackage rec {
   checkPhase = ''
     runHook preCheck
     $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
   '';