diff --git a/pkgs/development/python2-modules/mock/default.nix b/pkgs/development/python2-modules/mock/default.nix index 3e100689eb54..d65fede054b5 100644 --- a/pkgs/development/python2-modules/mock/default.nix +++ b/pkgs/development/python2-modules/mock/default.nix @@ -7,7 +7,6 @@ six, pbr, unittestCheckHook, - pytest, }: buildPythonPackage rec { @@ -35,7 +34,6 @@ buildPythonPackage rec { nativeCheckInputs = [ unittestCheckHook - pytest ]; meta = { diff --git a/pkgs/development/python2-modules/packaging/default.nix b/pkgs/development/python2-modules/packaging/default.nix index f5a0f459bd4e..b39721c46b3a 100644 --- a/pkgs/development/python2-modules/packaging/default.nix +++ b/pkgs/development/python2-modules/packaging/default.nix @@ -4,7 +4,6 @@ fetchPypi, pyparsing, six, - pytestCheckHook, pretend, }: @@ -27,7 +26,6 @@ buildPythonPackage rec { ]; nativeCheckInputs = [ - pytestCheckHook pretend ]; diff --git a/pkgs/development/python2-modules/pip/default.nix b/pkgs/development/python2-modules/pip/default.nix index 229f34fa1a7a..2ccdf3ca4189 100644 --- a/pkgs/development/python2-modules/pip/default.nix +++ b/pkgs/development/python2-modules/pip/default.nix @@ -7,7 +7,6 @@ scripttest, virtualenv, pretend, - pytest, }: buildPythonPackage rec { @@ -34,8 +33,8 @@ buildPythonPackage rec { scripttest virtualenv pretend - pytest ]; + # Pip wants pytest, but tests are not distributed doCheck = false; diff --git a/pkgs/development/python2-modules/pluggy/default.nix b/pkgs/development/python2-modules/pluggy/default.nix index 968068182188..b01e63c5834f 100644 --- a/pkgs/development/python2-modules/pluggy/default.nix +++ b/pkgs/development/python2-modules/pluggy/default.nix @@ -16,10 +16,6 @@ buildPythonPackage rec { sha256 = "15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0"; }; - checkPhase = '' - py.test - ''; - # To prevent infinite recursion with pytest doCheck = false; diff --git a/pkgs/development/python2-modules/pytest/default.nix b/pkgs/development/python2-modules/pytest/default.nix deleted file mode 100644 index b8ddc2299704..000000000000 --- a/pkgs/development/python2-modules/pytest/default.nix +++ /dev/null @@ -1,100 +0,0 @@ -{ - lib, - buildPythonPackage, - fetchPypi, - attrs, - py, - setuptools-scm, - setuptools, - six, - pluggy, - funcsigs, - isPy3k, - more-itertools, - atomicwrites, - mock, - writeText, - wcwidth, - packaging, - isPyPy, -}: -buildPythonPackage rec { - version = "4.6.11"; - format = "setuptools"; - pname = "pytest"; - - src = fetchPypi { - inherit pname version; - sha256 = "50fa82392f2120cc3ec2ca0a75ee615be4c479e66669789771f1758332be4353"; - }; - - postPatch = '' - substituteInPlace setup.py \ - --replace "pluggy>=0.12,<1.0" "pluggy>=0.12,<2.0" - ''; - - nativeCheckInputs = [ - mock - ]; - - buildInputs = [ setuptools-scm ]; - propagatedBuildInputs = [ - attrs - py - setuptools - six - pluggy - more-itertools - atomicwrites - wcwidth - packaging - ] - ++ lib.optionals (!isPy3k) [ funcsigs ]; - - doCheck = !isPyPy; # https://github.com/pytest-dev/pytest/issues/3460 - checkPhase = '' - runHook preCheck - - # don't test bash builtins - rm testing/test_argcomplete.py - - # determinism - this test writes non deterministic bytecode - rm -rf testing/test_assertrewrite.py - - PYTHONDONTWRITEBYTECODE=1 $out/bin/py.test -x testing/ -k "not test_collect_pyargs_with_testpaths" - runHook postCheck - ''; - - # Remove .pytest_cache when using py.test in a Nix build - setupHook = writeText "pytest-hook" '' - pytestcachePhase() { - find $out -name .pytest_cache -type d -exec rm -rf {} + - } - - appendToVar preDistPhases pytestcachePhase - - # pytest generates it's own bytecode files to improve assertion messages. - # These files similar to cpython's bytecode files but are never laoded - # by python interpreter directly. We remove them for a few reasons: - # - files are non-deterministic: https://github.com/NixOS/nixpkgs/issues/139292 - # (file headers are generatedt by pytest directly and contain timestamps) - # - files are not needed after tests are finished - pytestRemoveBytecodePhase () { - # suffix is defined at: - # https://github.com/pytest-dev/pytest/blob/4.6.11/src/_pytest/assertion/rewrite.py#L32-L47 - find $out -name "*-PYTEST.py[co]" -delete - } - appendToVar preDistPhases pytestRemoveBytecodePhase - ''; - - meta = { - homepage = "https://docs.pytest.org"; - description = "Framework for writing tests"; - maintainers = with lib.maintainers; [ - lovek323 - madjar - ]; - license = lib.licenses.mit; - platforms = lib.platforms.unix; - }; -} diff --git a/pkgs/development/python2-modules/zipp/default.nix b/pkgs/development/python2-modules/zipp/default.nix index a08e88cc6d7d..ed94f8e364a5 100644 --- a/pkgs/development/python2-modules/zipp/default.nix +++ b/pkgs/development/python2-modules/zipp/default.nix @@ -3,8 +3,6 @@ buildPythonPackage, fetchPypi, setuptools-scm, - pytest, - pytest-flake8, more-itertools, }: @@ -22,15 +20,6 @@ buildPythonPackage rec { propagatedBuildInputs = [ more-itertools ]; - nativeCheckInputs = [ - pytest - pytest-flake8 - ]; - - checkPhase = '' - pytest - ''; - # Prevent infinite recursion with pytest doCheck = false; diff --git a/pkgs/top-level/python2-packages.nix b/pkgs/top-level/python2-packages.nix index 52a45fc64b7d..0f8b544c1959 100644 --- a/pkgs/top-level/python2-packages.nix +++ b/pkgs/top-level/python2-packages.nix @@ -51,9 +51,9 @@ with super; pyparsing = disabled super.pyparsing; - pytest = pytest_4; + pytest = disabled super.pytest; - pytest_4 = callPackage ../development/python2-modules/pytest { }; + pytest_4 = disabled super.pytest; pytest-xdist = disabled super.pytest-xdist;