pythonPackages.pytest-mock: refactor fix broken package

This commit is contained in:
Chris Ostrouchov 2019-07-16 17:39:20 -04:00 committed by Frederik Rietdijk
parent d391561768
commit 248fd7a46c
2 changed files with 26 additions and 6 deletions

View File

@ -14,12 +14,15 @@ buildPythonPackage rec {
sha256 = "03e4dece2d1aa91666034f1b2e8bb7a7b8c6be11baf3cf2929b26eea5c6e86f3"; sha256 = "03e4dece2d1aa91666034f1b2e8bb7a7b8c6be11baf3cf2929b26eea5c6e86f3";
}; };
propagatedBuildInputs = [ buildInputs = [
pyannotate
pytest pytest
]; ];
postConfigure = '' propagatedBuildInputs = [
pyannotate
];
postPatch = ''
substituteInPlace setup.py \ substituteInPlace setup.py \
--replace "pytest>=3.2.0,<4.0.0" "pytest" --replace "pytest>=3.2.0,<4.0.0" "pytest"
''; '';

View File

@ -1,4 +1,12 @@
{ lib, buildPythonPackage, fetchPypi, fetchpatch, isPy3k, pytest, mock, setuptools_scm }: { lib
, buildPythonPackage
, fetchPypi
, fetchpatch
, isPy3k
, pytest
, mock
, setuptools_scm
}:
buildPythonPackage rec { buildPythonPackage rec {
pname = "pytest-mock"; pname = "pytest-mock";
@ -10,7 +18,14 @@ buildPythonPackage rec {
}; };
propagatedBuildInputs = lib.optional (!isPy3k) mock; propagatedBuildInputs = lib.optional (!isPy3k) mock;
nativeBuildInputs = [ setuptools_scm pytest ];
nativeBuildInputs = [
setuptools_scm
];
checkInputs = [
pytest
];
patches = [ patches = [
# Fix tests for pytest 4.6. Remove with the next release # Fix tests for pytest 4.6. Remove with the next release
@ -21,7 +36,9 @@ buildPythonPackage rec {
]; ];
checkPhase = '' 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; { meta = with lib; {