Merge pull request #119126 from fabaff/pycomfoconnect
[NixPkgs.git] / pkgs / development / python-modules / pytest / 5.nix
blob341d5ac2240d5d349edf740785b050cf69d325e5
1 { lib, buildPythonPackage, pythonOlder, fetchPypi, isPy3k, isPyPy
2 , atomicwrites
3 , attrs
4 , funcsigs
5 , hypothesis
6 , mock
7 , more-itertools
8 , packaging
9 , pathlib2
10 , pluggy
11 , py
12 , pygments
13 , python
14 , setuptools
15 , setuptools_scm
16 , six
17 , toml
18 , wcwidth
19 , writeText
22 buildPythonPackage rec {
23   version = "5.4.3";
24   pname = "pytest";
26   disabled = !isPy3k;
28   src = fetchPypi {
29     inherit pname version;
30     sha256 = "1n67lk8iwlsmfdm8663k8l7isllg1xd3n9p1yla7885szhdk6ybr";
31   };
33   checkInputs = [ hypothesis pygments ];
34   nativeBuildInputs = [ setuptools_scm ];
35   propagatedBuildInputs = [
36     atomicwrites
37     attrs
38     more-itertools
39     packaging
40     pluggy
41     py
42     setuptools
43     six
44     toml
45     wcwidth
46   ] ++ lib.optionals (pythonOlder "3.6") [ pathlib2 ];
48   doCheck = !isPyPy; # https://github.com/pytest-dev/pytest/issues/3460
50   preCheck = ''
51     # don't test bash builtins
52     rm testing/test_argcomplete.py
53   '';
55   # Ignored file https://github.com/pytest-dev/pytest/pull/5605#issuecomment-522243929
56   checkPhase = ''
57     runHook preCheck
58     $out/bin/py.test -x testing/ -k "not test_collect_pyargs_with_testpaths" --ignore=testing/test_junitxml.py
59     runHook postCheck
60   '';
62   # Remove .pytest_cache when using py.test in a Nix build
63   setupHook = writeText "pytest-hook" ''
64     pytestcachePhase() {
65         find $out -name .pytest_cache -type d -exec rm -rf {} +
66     }
67     preDistPhases+=" pytestcachePhase"
68   '';
70   pythonImportsCheck = [
71     "pytest"
72   ];
74   meta = with lib; {
75     homepage = "https://docs.pytest.org";
76     description = "Framework for writing tests";
77     maintainers = with maintainers; [ domenkozar lovek323 madjar lsix ];
78     license = licenses.mit;
79   };