2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, isPy27
|
|
|
|
, funcsigs
|
|
|
|
, six
|
|
|
|
, pbr
|
|
|
|
, python
|
2020-06-02 18:00:15 +00:00
|
|
|
, pytest
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "mock";
|
2020-06-02 18:00:15 +00:00
|
|
|
version = "4.0.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-06-02 18:00:15 +00:00
|
|
|
sha256 = "dd33eb70232b6118298d516bbcecd26704689c386594f0f3c4f13867b2c56f72";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ six pbr ] ++ lib.optionals isPy27 [ funcsigs ];
|
|
|
|
|
|
|
|
# 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-06-02 18:00:15 +00:00
|
|
|
#doCheck = !(python.isPyPy && python.isPy27);
|
|
|
|
doCheck = false; # Infinite recursion pytest
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
${python.interpreter} -m unittest discover
|
|
|
|
'';
|
|
|
|
|
2020-06-02 18:00:15 +00:00
|
|
|
checkInputs = [
|
|
|
|
pytest
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Mock objects for Python";
|
|
|
|
homepage = "http://python-mock.sourceforge.net/";
|
|
|
|
license = licenses.bsd2;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|