mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-29 16:24:10 +00:00
python.pkgs.pytest: fix setupHook .pytest-cache
In 610485faa7
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`.
This commit is contained in:
parent
c5758bd67e
commit
bb147bbc0b
@ -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; {
|
||||
|
Loading…
Reference in New Issue
Block a user