summary refs log tree commit diff
path: root/pkgs/development/python-modules/pytest/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/pytest/default.nix')
-rw-r--r--pkgs/development/python-modules/pytest/default.nix7
1 files changed, 6 insertions, 1 deletions
diff --git a/pkgs/development/python-modules/pytest/default.nix b/pkgs/development/python-modules/pytest/default.nix
index b5a8cc252b9..1c0ceef8365 100644
--- a/pkgs/development/python-modules/pytest/default.nix
+++ b/pkgs/development/python-modules/pytest/default.nix
@@ -1,6 +1,6 @@
 { stdenv, buildPythonPackage, fetchPypi, attrs, hypothesis, py
 , setuptools_scm, setuptools, six, pluggy, funcsigs, isPy3k, more-itertools
-, atomicwrites, mock
+, atomicwrites, mock, writeText
 }:
 buildPythonPackage rec {
   version = "3.6.2";
@@ -27,6 +27,11 @@ buildPythonPackage rec {
     runHook postCheck
   '';
 
+  # Don't create .pytest-cache when using py.test in a Nix build
+  setupHook = writeText "pytest-hook" ''
+    export PYTEST_ADDOPTS="-p no:cacheprovider"
+  '';
+
   meta = with stdenv.lib; {
     maintainers = with maintainers; [ domenkozar lovek323 madjar lsix ];
     platforms = platforms.unix;