From 248fd7a46c57773cc4f5090183d45a2be3be2878 Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Tue, 16 Jul 2019 17:39:20 -0400 Subject: [PATCH] pythonPackages.pytest-mock: refactor fix broken package --- .../pytest-annotate/default.nix | 9 +++++--- .../python-modules/pytest-mock/default.nix | 23 ++++++++++++++++--- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/pytest-annotate/default.nix b/pkgs/development/python-modules/pytest-annotate/default.nix index 86f344b0e94..12a7baa55bf 100644 --- a/pkgs/development/python-modules/pytest-annotate/default.nix +++ b/pkgs/development/python-modules/pytest-annotate/default.nix @@ -14,12 +14,15 @@ buildPythonPackage rec { sha256 = "03e4dece2d1aa91666034f1b2e8bb7a7b8c6be11baf3cf2929b26eea5c6e86f3"; }; - propagatedBuildInputs = [ - pyannotate + buildInputs = [ pytest ]; - postConfigure = '' + propagatedBuildInputs = [ + pyannotate + ]; + + postPatch = '' substituteInPlace setup.py \ --replace "pytest>=3.2.0,<4.0.0" "pytest" ''; diff --git a/pkgs/development/python-modules/pytest-mock/default.nix b/pkgs/development/python-modules/pytest-mock/default.nix index 8fba5e90ab1..58e032df4df 100644 --- a/pkgs/development/python-modules/pytest-mock/default.nix +++ b/pkgs/development/python-modules/pytest-mock/default.nix @@ -1,4 +1,12 @@ -{ lib, buildPythonPackage, fetchPypi, fetchpatch, isPy3k, pytest, mock, setuptools_scm }: +{ lib +, buildPythonPackage +, fetchPypi +, fetchpatch +, isPy3k +, pytest +, mock +, setuptools_scm +}: buildPythonPackage rec { pname = "pytest-mock"; @@ -10,7 +18,14 @@ buildPythonPackage rec { }; propagatedBuildInputs = lib.optional (!isPy3k) mock; - nativeBuildInputs = [ setuptools_scm pytest ]; + + nativeBuildInputs = [ + setuptools_scm + ]; + + checkInputs = [ + pytest + ]; patches = [ # Fix tests for pytest 4.6. Remove with the next release @@ -21,7 +36,9 @@ buildPythonPackage rec { ]; checkPhase = '' - py.test + # remove disabled test on next release + # https://github.com/pytest-dev/pytest-mock/pull/151 + pytest -k "not test_detailed_introspection" ''; meta = with lib; {