about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/vcrpy/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/vcrpy/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/vcrpy/default.nix48
1 files changed, 48 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/vcrpy/default.nix b/nixpkgs/pkgs/development/python-modules/vcrpy/default.nix
new file mode 100644
index 000000000000..13f7753831b4
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/vcrpy/default.nix
@@ -0,0 +1,48 @@
+{ buildPythonPackage
+, lib
+, six
+, fetchPypi
+, pyyaml
+, mock
+, contextlib2
+, wrapt
+, pytest
+, pytest-httpbin
+, yarl
+, pythonOlder
+, pythonAtLeast
+}:
+
+buildPythonPackage rec {
+  pname = "vcrpy";
+  version = "2.0.1";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "0kws7l3hci1dvjv01nxw3805q9v2mwldw58bgl8s90wqism69gjp";
+  };
+
+  checkInputs = [
+    pytest
+    pytest-httpbin
+  ];
+
+  propagatedBuildInputs = [
+    pyyaml
+    wrapt
+    six
+  ]
+  ++ lib.optionals (pythonOlder "3.3") [ contextlib2 mock ]
+  ++ lib.optionals (pythonAtLeast "3.4") [ yarl ];
+
+  checkPhase = ''
+    py.test --ignore=tests/integration -k "not TestVCRConnection"
+  '';
+
+  meta = with lib; {
+    description = "Automatically mock your HTTP interactions to simplify and speed up testing";
+    homepage = https://github.com/kevin1024/vcrpy;
+    license = licenses.mit;
+  };
+}
+