From 34b3a0897f3ac024185a48c740af63937988eae2 Mon Sep 17 00:00:00 2001 From: Timo Kaufmann Date: Tue, 30 Oct 2018 13:12:59 +0100 Subject: [PATCH] pythonPackages.entrypoints: fix python2 build The recent pytest upgrade in bea4b361a0e3a21b1e9a69d56f1ebd16fb38a296 broke the test suite. --- .../python-modules/entrypoints/default.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/entrypoints/default.nix b/pkgs/development/python-modules/entrypoints/default.nix index 9ee0810571a..3f79e663455 100644 --- a/pkgs/development/python-modules/entrypoints/default.nix +++ b/pkgs/development/python-modules/entrypoints/default.nix @@ -4,6 +4,7 @@ , configparser , pytest , isPy3k +, isPy27 }: buildPythonPackage rec { @@ -19,8 +20,15 @@ buildPythonPackage rec { propagatedBuildInputs = lib.optional (!isPy3k) configparser; - checkPhase = '' - py.test tests + checkPhase = let + # On python2 with pytest 3.9.2 (not with pytest 3.7.4) the test_bad + # test fails. It tests that a warning (exectly one) is thrown on a "bad" + # path. The pytest upgrade added some warning, resulting in two warnings + # being thrown. + # upstream: https://github.com/takluyver/entrypoints/issues/23 + pyTestArgs = if isPy27 then "-k 'not test_bad'" else ""; + in '' + py.test ${pyTestArgs} tests ''; meta = {