1 { lib, buildPythonPackage, pythonOlder, fetchPypi, isPy3k, isPyPy
20 buildPythonPackage rec {
26 inherit pname version;
27 sha256 = "sha256-nR7fnn0LhNcuo9vN/SKzX7VDpejypgCS3VeJNr9j1/k=";
30 nativeBuildInputs = [ setuptools-scm ];
32 propagatedBuildInputs = [
44 ] ++ lib.optionals (pythonOlder "3.6") [ pathlib2 ];
51 doCheck = !isPyPy; # https://github.com/pytest-dev/pytest/issues/3460
54 # don't test bash builtins
55 rm testing/test_argcomplete.py
58 # Ignored file https://github.com/pytest-dev/pytest/pull/5605#issuecomment-522243929
61 $out/bin/py.test -x testing/ -k "not test_collect_pyargs_with_testpaths" --ignore=testing/test_junitxml.py
63 # tests leave behind unreproducible pytest binaries in the output directory, remove:
64 find $out/lib -name "*-pytest-${version}.pyc" -delete
65 # specifically testing/test_assertion.py and testing/test_assertrewrite.py leave behind those:
66 find $out/lib -name "*opt-2.pyc" -delete
71 # Remove .pytest_cache when using py.test in a Nix build
72 setupHook = writeText "pytest-hook" ''
74 find $out -name .pytest_cache -type d -exec rm -rf {} +
76 preDistPhases+=" pytestcachePhase"
79 pythonImportsCheck = [
84 description = "Framework for writing tests";
85 homepage = "https://docs.pytest.org";
86 changelog = "https://github.com/pytest-dev/pytest/releases/tag/${version}";
87 maintainers = with maintainers; [ domenkozar lovek323 madjar lsix ];
88 license = licenses.mit;