2021-06-06 21:20:35 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, pytest
|
|
|
|
, coverage
|
2021-06-18 23:41:54 +00:00
|
|
|
, toml
|
2021-06-06 21:20:35 +00:00
|
|
|
}:
|
2018-04-03 10:51:10 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pytest-cov";
|
2021-06-06 21:20:35 +00:00
|
|
|
version = "2.12.1";
|
2018-04-03 10:51:10 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-06-18 21:47:34 +00:00
|
|
|
sha256 = "1mzl06m8qcgsac1r2krixrkqdwq0nqk8asrpkcj2ddr7qawfw716";
|
2018-04-03 10:51:10 +00:00
|
|
|
};
|
|
|
|
|
2019-02-14 10:10:24 +00:00
|
|
|
buildInputs = [ pytest ];
|
2021-06-06 21:20:35 +00:00
|
|
|
|
2021-06-18 23:41:54 +00:00
|
|
|
propagatedBuildInputs = [ coverage toml ];
|
2018-04-03 10:51:10 +00: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 21:20:35 +00:00
|
|
|
pythonImportsCheck = [ "pytest_cov" ];
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2018-04-03 10:51:10 +00:00
|
|
|
description = "Plugin for coverage reporting with support for both centralised and distributed testing, including subprocesses and multiprocessing";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/pytest-dev/pytest-cov";
|
2018-04-03 10:51:10 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
}
|