diff --git a/pkgs/development/python-modules/pytest/default.nix b/pkgs/development/python-modules/pytest/default.nix index b5a8cc252b975..1c0ceef83657a 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;