1{ lib
2, buildPythonPackage
3, fetchPypi
4, pytest
5, coverage
6, toml
7}:
8
9buildPythonPackage rec {
10 pname = "pytest-cov";
11 version = "2.12.1";
12
13 src = fetchPypi {
14 inherit pname version;
15 sha256 = "1mzl06m8qcgsac1r2krixrkqdwq0nqk8asrpkcj2ddr7qawfw716";
16 };
17
18 buildInputs = [ pytest ];
19
20 propagatedBuildInputs = [ coverage toml ];
21
22 # xdist related tests fail with the following error
23 # OSError: [Errno 13] Permission denied: 'py/_code'
24 doCheck = false;
25 checkPhase = ''
26 # allow to find the module helper during the test run
27 export PYTHONPATH=$PYTHONPATH:$PWD/tests
28 py.test tests
29 '';
30
31 pythonImportsCheck = [ "pytest_cov" ];
32
33 meta = with lib; {
34 description = "Plugin for coverage reporting with support for both centralised and distributed testing, including subprocesses and multiprocessing";
35 homepage = "https://github.com/pytest-dev/pytest-cov";
36 license = licenses.mit;
37 };
38}