Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / pytest / tests.nix
blob3fc078148b203da120cd351c678a749b5fcdbb26
1 { buildPythonPackage
2 , isPyPy
3 , pytest
4 , hypothesis
5 , pygments
6 }:
8 buildPythonPackage rec {
9   pname = "pytest-tests";
10   inherit (pytest) version;
12   src = pytest.testout;
14   dontBuild = true;
15   dontInstall = true;
17   nativeCheckInputs = [
18     hypothesis
19     pygments
20   ];
22   doCheck = !isPyPy; # https://github.com/pytest-dev/pytest/issues/3460
24   # Ignored file https://github.com/pytest-dev/pytest/pull/5605#issuecomment-522243929
25   # test_missing_required_plugins will emit deprecation warning which is treated as error
26   checkPhase = ''
27     runHook preCheck
28     ${pytest.out}/bin/py.test -x testing/ \
29       --ignore=testing/test_junitxml.py \
30       --ignore=testing/test_argcomplete.py \
31       -k "not test_collect_pyargs_with_testpaths and not test_missing_required_plugins"
33     # tests leave behind unreproducible pytest binaries in the output directory, remove:
34     find $out/lib -name "*-pytest-${version}.pyc" -delete
35     # specifically testing/test_assertion.py and testing/test_assertrewrite.py leave behind those:
36     find $out/lib -name "*opt-2.pyc" -delete
38     runHook postCheck
39   '';