1{ buildPythonPackage
2, lib
3, six
4, fetchPypi
5, pyyaml
6, mock
7, contextlib2
8, wrapt
9, pytest
10, pytest-httpbin
11, yarl
12, pythonOlder
13, pythonAtLeast
14}:
15
16buildPythonPackage rec {
17 pname = "vcrpy";
18 version = "1.13.0";
19
20 src = fetchPypi {
21 inherit pname version;
22 sha256 = "7031f9c78a70b9586d2db4a2ec135c4e04194cabff58695ef0cc95e7cd66bc01";
23 };
24
25 checkInputs = [
26 pytest
27 pytest-httpbin
28 ];
29
30 propagatedBuildInputs = [
31 pyyaml
32 wrapt
33 six
34 ]
35 ++ lib.optionals (pythonOlder "3.3") [ contextlib2 mock ]
36 ++ lib.optionals (pythonAtLeast "3.4") [ yarl ];
37
38 checkPhase = ''
39 py.test --ignore=tests/integration -k "not TestVCRConnection"
40 '';
41
42 meta = with lib; {
43 description = "Automatically mock your HTTP interactions to simplify and speed up testing";
44 homepage = https://github.com/kevin1024/vcrpy;
45 license = licenses.mit;
46 };
47}
48