From 610485faa7f8c043482c4a9c030938ed315557e5 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sun, 22 Jul 2018 09:45:26 +0200 Subject: python.pkgs.pytest: setupHook to prevent creation of .pytest-cache folder, fixes #40273 When `py.test` was run with a folder as argument, it would not only search for tests in that folder, but also create a .pytest-cache folder. Not only is this state we don't want, but it was also causing collisions. --- pkgs/development/python-modules/pytest/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'pkgs/development/python-modules/pytest/default.nix') diff --git a/pkgs/development/python-modules/pytest/default.nix b/pkgs/development/python-modules/pytest/default.nix index b5a8cc252b97..1c0ceef83657 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; -- cgit 1.4.1