From 3f4dea0c89be8526852cbb0fe064d990db929722 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Mon, 1 May 2017 09:11:52 +0200 Subject: [PATCH] pythonPackages.vcrpy: fix tests --- .../python-modules/vcrpy/default.nix | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/pkgs/development/python-modules/vcrpy/default.nix b/pkgs/development/python-modules/vcrpy/default.nix index c925649b8b2b..c82a02cb4a47 100644 --- a/pkgs/development/python-modules/vcrpy/default.nix +++ b/pkgs/development/python-modules/vcrpy/default.nix @@ -1,38 +1,44 @@ { buildPythonPackage , lib -, pkgs +, six +, fetchPypi , pyyaml , mock , contextlib2 , wrapt -, pytest_27 +, pytest , httpbin , pytest-httpbin , yarl +, pythonOlder +, pythonAtLeast }: buildPythonPackage rec { + pname = "vcrpy"; version = "1.10.5"; - name = "vcrpy-${version}"; + name = "${pname}-${version}"; - src = pkgs.fetchurl { - url = "mirror://pypi/v/vcrpy/vcrpy-${version}.tar.gz"; + src = fetchPypi { + inherit pname version; sha256 = "12kncg6jyvj15mi8ca74514f2x1ih753nhyz769nwvh39r468167"; }; - buildInputs = [ - pyyaml - mock - contextlib2 - wrapt - pytest_27 - httpbin + checkInputs = [ + pytest pytest-httpbin - yarl ]; + propagatedBuildInputs = [ + pyyaml + wrapt + six + ] + ++ lib.optionals (pythonOlder "3.3") [ contextlib2 mock ] + ++ lib.optionals (pythonAtLeast "3.4") [ yarl ]; + checkPhase = '' - py.test --ignore=tests/integration -k "TestVCRConnection.testing_connect" + py.test --ignore=tests/integration -k "not TestVCRConnection" ''; meta = with lib; {