1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 isPy27,
6 funcsigs,
7 six,
8 pbr,
9 unittestCheckHook,
10 pytest,
11}:
12
13buildPythonPackage rec {
14 pname = "mock";
15 version = "3.0.5";
16
17 src = fetchPypi {
18 inherit pname version;
19 sha256 = "83657d894c90d5681d62155c82bda9c1187827525880eda8ff5df4ec813437c3";
20 };
21
22 propagatedBuildInputs = [
23 six
24 pbr
25 ] ++ lib.optionals isPy27 [ funcsigs ];
26
27 # On PyPy for Python 2.7 in particular, Mock's tests have a known failure.
28 # Mock upstream has a decoration to disable the failing test and make
29 # everything pass, but it is not yet released. The commit:
30 # https://github.com/testing-cabal/mock/commit/73bfd51b7185#diff-354f30a63fb0907d4ad57269548329e3L12
31 #doCheck = !(python.isPyPy && python.isPy27);
32 doCheck = false; # Infinite recursion pytest
33
34 nativeCheckInputs = [
35 unittestCheckHook
36 pytest
37 ];
38
39 meta = with lib; {
40 description = "Mock objects for Python";
41 homepage = "http://python-mock.sourceforge.net/";
42 license = licenses.bsd2;
43 };
44
45}