2019-11-21 01:53:28 +00:00
|
|
|
{ lib
|
2018-10-16 23:15:17 +01:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2019-11-21 01:53:28 +00:00
|
|
|
, isPy27
|
2018-10-16 23:15:17 +01:00
|
|
|
, funcsigs
|
|
|
|
, six
|
|
|
|
, pbr
|
|
|
|
, python
|
2020-05-09 12:15:43 +01:00
|
|
|
, pytest
|
2018-10-16 23:15:17 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "mock";
|
2021-02-20 09:09:11 +00:00
|
|
|
version = "4.0.3";
|
2018-10-16 23:15:17 +01:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-02-20 09:09:11 +00:00
|
|
|
sha256 = "7d3fbbde18228f4ff2f1f119a45cdffa458b4c0dee32eb4d2bb2f82554bac7bc";
|
2018-10-16 23:15:17 +01:00
|
|
|
};
|
|
|
|
|
2019-11-21 01:53:28 +00:00
|
|
|
propagatedBuildInputs = [ six pbr ] ++ lib.optionals isPy27 [ funcsigs ];
|
2018-10-16 23:15:17 +01:00
|
|
|
|
2019-02-04 08:18:17 +00:00
|
|
|
# On PyPy for Python 2.7 in particular, Mock's tests have a known failure.
|
|
|
|
# Mock upstream has a decoration to disable the failing test and make
|
|
|
|
# everything pass, but it is not yet released. The commit:
|
|
|
|
# https://github.com/testing-cabal/mock/commit/73bfd51b7185#diff-354f30a63fb0907d4ad57269548329e3L12
|
2020-05-09 12:15:43 +01:00
|
|
|
#doCheck = !(python.isPyPy && python.isPy27);
|
|
|
|
doCheck = false; # Infinite recursion pytest
|
2019-02-04 08:18:17 +00:00
|
|
|
|
2018-10-16 23:15:17 +01:00
|
|
|
checkPhase = ''
|
|
|
|
${python.interpreter} -m unittest discover
|
|
|
|
'';
|
|
|
|
|
2020-05-09 12:15:43 +01:00
|
|
|
checkInputs = [
|
|
|
|
pytest
|
|
|
|
];
|
|
|
|
|
2019-11-21 01:53:28 +00:00
|
|
|
meta = with lib; {
|
2018-10-16 23:15:17 +01:00
|
|
|
description = "Mock objects for Python";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://python-mock.sourceforge.net/";
|
2019-11-21 01:53:28 +00:00
|
|
|
license = licenses.bsd2;
|
2018-10-16 23:15:17 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|