2021-06-06 23:20:35 +02:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, pytest
|
|
|
|
, coverage
|
2021-06-18 16:41:54 -07:00
|
|
|
, toml
|
2022-01-13 19:07:53 -08:00
|
|
|
, tomli
|
2021-06-06 23:20:35 +02:00
|
|
|
}:
|
2018-04-03 12:51:10 +02:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pytest-cov";
|
2022-01-13 16:58:48 -08:00
|
|
|
version = "3.0.0";
|
2018-04-03 12:51:10 +02:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-01-13 16:58:48 -08:00
|
|
|
sha256 = "e7f0f5b1617d2210a2cabc266dfe2f4c75a8d32fb89eafb7ad9d06f6d076d470";
|
2018-04-03 12:51:10 +02:00
|
|
|
};
|
|
|
|
|
2019-02-14 11:10:24 +01:00
|
|
|
buildInputs = [ pytest ];
|
2021-06-06 23:20:35 +02:00
|
|
|
|
2022-01-13 19:07:53 -08:00
|
|
|
propagatedBuildInputs = [ coverage toml tomli ];
|
2018-04-03 12:51:10 +02:00
|
|
|
|
|
|
|
# xdist related tests fail with the following error
|
|
|
|
# OSError: [Errno 13] Permission denied: 'py/_code'
|
|
|
|
doCheck = false;
|
|
|
|
checkPhase = ''
|
|
|
|
# allow to find the module helper during the test run
|
|
|
|
export PYTHONPATH=$PYTHONPATH:$PWD/tests
|
|
|
|
py.test tests
|
|
|
|
'';
|
|
|
|
|
2021-06-06 23:20:35 +02:00
|
|
|
pythonImportsCheck = [ "pytest_cov" ];
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2018-04-03 12:51:10 +02:00
|
|
|
description = "Plugin for coverage reporting with support for both centralised and distributed testing, including subprocesses and multiprocessing";
|
2020-03-31 21:11:51 -04:00
|
|
|
homepage = "https://github.com/pytest-dev/pytest-cov";
|
2018-04-03 12:51:10 +02:00
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
}
|