mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 00:12:56 +00:00
paperless-ng: use pytestCheckHook and reorganize the checkPhase
This commit is contained in:
parent
dc16356f77
commit
95f3334e3e
@ -165,27 +165,6 @@ py.pkgs.pythonPackages.buildPythonApplication rec {
|
||||
zope_interface
|
||||
];
|
||||
|
||||
doCheck = true;
|
||||
checkInputs = with py.pkgs.pythonPackages; [
|
||||
pytest
|
||||
pytest-cov
|
||||
pytest-django
|
||||
pytest-env
|
||||
pytest-sugar
|
||||
pytest-xdist
|
||||
factory_boy
|
||||
];
|
||||
|
||||
# The tests require:
|
||||
# - PATH with runtime binaries
|
||||
# - A temporary HOME directory for gnupg
|
||||
# - XDG_DATA_DIRS with test-specific fonts
|
||||
checkPhase = ''
|
||||
pushd src
|
||||
PATH="${path}:$PATH" HOME=$(mktemp -d) XDG_DATA_DIRS="${liberation_ttf}/share:$XDG_DATA_DIRS" pytest
|
||||
popd
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/lib
|
||||
cp -r . $out/lib/paperless-ng
|
||||
@ -195,6 +174,31 @@ py.pkgs.pythonPackages.buildPythonApplication rec {
|
||||
--prefix PATH : "${path}"
|
||||
'';
|
||||
|
||||
checkInputs = with py.pkgs.pythonPackages; [
|
||||
pytest-django
|
||||
pytest-env
|
||||
pytest-sugar
|
||||
pytest-xdist
|
||||
factory_boy
|
||||
pytestCheckHook
|
||||
];
|
||||
|
||||
pytestFlagsArray = [ "src" ];
|
||||
|
||||
# The tests require:
|
||||
# - PATH with runtime binaries
|
||||
# - A temporary HOME directory for gnupg
|
||||
# - XDG_DATA_DIRS with test-specific fonts
|
||||
preCheck = ''
|
||||
export PATH="${path}:$PATH"
|
||||
export HOME=$(mktemp -d)
|
||||
export XDG_DATA_DIRS="${liberation_ttf}/share:$XDG_DATA_DIRS"
|
||||
|
||||
# Disable unneeded code coverage test
|
||||
substituteInPlace src/setup.cfg \
|
||||
--replace "--cov --cov-report=html" ""
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
# PYTHONPATH of all dependencies used by the package
|
||||
pythonPath = python3.pkgs.makePythonPath propagatedBuildInputs;
|
||||
|
Loading…
Reference in New Issue
Block a user