From eb2ba8ac0d86fbbc35ad2a4b3cd840318cb11533 Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Thu, 10 May 2018 09:52:22 +0900 Subject: [PATCH] pythonPackages.configobj: enable tests I found a bug in configobj and wanted to run the testsuite to confirm it was a bugs rather than a nixos oddity. Now that tests work let's upstream it. --- .../python-modules/configobj/default.nix | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/configobj/default.nix b/pkgs/development/python-modules/configobj/default.nix index 98631b6920b3..dd2b26e0f591 100644 --- a/pkgs/development/python-modules/configobj/default.nix +++ b/pkgs/development/python-modules/configobj/default.nix @@ -1,19 +1,30 @@ -{ stdenv, buildPythonPackage, fetchPypi, six }: +{ stdenv, buildPythonPackage +, fetchFromGitHub +, six +, mock, pytest +}: buildPythonPackage rec { pname = "configobj"; version = "5.0.6"; - src = fetchPypi { - inherit pname version; - sha256 = "00h9rcmws03xvdlfni11yb60bz3kxfvsj6dg6nrpzj71f03nbxd2"; + # Pypi archives don't contain the tests + src = fetchFromGitHub { + owner = "DiffSK"; + repo = pname; + rev = "v${version}"; + sha256 = "0x97794nk3dfn0i3si9fv7y19jnpnarb34bkdwlz7ii7ag6xihhw"; }; - # error: invalid command 'test' - doCheck = false; propagatedBuildInputs = [ six ]; + checkPhase = '' + pytest --deselect=tests/test_configobj.py::test_options_deprecation + ''; + + checkInputs = [ mock pytest ]; + meta = with stdenv.lib; { description = "Config file reading, writing and validation"; homepage = https://pypi.python.org/pypi/configobj;