1{ buildPythonPackage 2, isPyPy 3, pytest 4, hypothesis 5, pygments 6}: 7 8buildPythonPackage rec { 9 pname = "pytest-tests"; 10 inherit (pytest) version; 11 12 src = pytest.testout; 13 14 dontBuild = true; 15 dontInstall = true; 16 17 checkInputs = [ 18 hypothesis 19 pygments 20 ]; 21 22 doCheck = !isPyPy; # https://github.com/pytest-dev/pytest/issues/3460 23 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" 32 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 37 38 runHook postCheck 39 ''; 40}