summary refs log tree commit diff
path: root/pkgs/development/python-modules/pytest
diff options
context:
space:
mode:
authorFrederik Rietdijk <fridh@fridh.nl>2018-07-24 17:06:01 +0200
committerFrederik Rietdijk <fridh@fridh.nl>2018-07-26 12:43:17 +0200
commitbb147bbc0bc1d904f0aef3112b80c048808ddf0b (patch)
treea1447a228973f5bbb3269e3bbe316374d9b4d30d /pkgs/development/python-modules/pytest
parentc5758bd67e58d4488e2e56f4162bad3844799915 (diff)
downloadnixpkgs-bb147bbc0bc1d904f0aef3112b80c048808ddf0b.tar
nixpkgs-bb147bbc0bc1d904f0aef3112b80c048808ddf0b.tar.gz
nixpkgs-bb147bbc0bc1d904f0aef3112b80c048808ddf0b.tar.bz2
nixpkgs-bb147bbc0bc1d904f0aef3112b80c048808ddf0b.tar.lz
nixpkgs-bb147bbc0bc1d904f0aef3112b80c048808ddf0b.tar.xz
nixpkgs-bb147bbc0bc1d904f0aef3112b80c048808ddf0b.tar.zst
nixpkgs-bb147bbc0bc1d904f0aef3112b80c048808ddf0b.zip
python.pkgs.pytest: fix setupHook .pytest-cache
In 610485faa7f8c043482c4a9c030938ed315557e5 a setupHook was added to `pytest`
to prevent the creation of `.pytest-cache` folder. Some pytest plugins relied
on the cache and were thus failing.

This commit permits the cache during build time but removes it in a `postFixupHook`.
Diffstat (limited to 'pkgs/development/python-modules/pytest')
-rw-r--r--pkgs/development/python-modules/pytest/default.nix6
1 files changed, 4 insertions, 2 deletions
diff --git a/pkgs/development/python-modules/pytest/default.nix b/pkgs/development/python-modules/pytest/default.nix
index 2edce6e6ae9..5fda0994010 100644
--- a/pkgs/development/python-modules/pytest/default.nix
+++ b/pkgs/development/python-modules/pytest/default.nix
@@ -27,9 +27,11 @@ buildPythonPackage rec {
     runHook postCheck
   '';
 
-  # Don't create .pytest-cache when using py.test in a Nix build
+  # Remove .pytest-cache when using py.test in a Nix build
   setupHook = writeText "pytest-hook" ''
-    export PYTEST_ADDOPTS="-p no:cacheprovider"
+    postFixupHooks+=(
+        'find $out -name .pytest-cache -type d -exec rm -rf {} +'
+    )
   '';
 
   meta = with stdenv.lib; {