From 1d86636aca9f795215668e3c5d297e20b84bf272 Mon Sep 17 00:00:00 2001 From: Drew Risinger Date: Sat, 12 Sep 2020 11:29:32 -0400 Subject: [PATCH] python27Packages.anytree: fix build Tests fail on python2.7 b/c the tests use enums (python 3.4+). Follow-on from #97761. Converts tests to use pytestCheckHook for easier test disabling. --- .../python-modules/anytree/default.nix | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/pkgs/development/python-modules/anytree/default.nix b/pkgs/development/python-modules/anytree/default.nix index 6b25952493b..c11833ba579 100644 --- a/pkgs/development/python-modules/anytree/default.nix +++ b/pkgs/development/python-modules/anytree/default.nix @@ -1,13 +1,15 @@ { lib , buildPythonPackage , fetchPypi +, pythonOlder , substituteAll -, fetchpatch -, nose , six , withGraphviz ? true , graphviz , fontconfig +# Tests +, pytestCheckHook +, nose }: buildPythonPackage rec { @@ -26,10 +28,6 @@ buildPythonPackage rec { }) ]; - checkInputs = [ - nose - ]; - propagatedBuildInputs = [ six ]; @@ -42,13 +40,13 @@ buildPythonPackage rec { # circular dependency anytree → graphviz → pango → glib → gtk-doc → anytree doCheck = withGraphviz; - checkPhase = '' - runHook preCheck + checkInputs = [ pytestCheckHook nose ]; - nosetests - - runHook postCheck - ''; + pytestFlagsArray = lib.optionals (pythonOlder "3.4") [ + # Use enums, which aren't available pre-python3.4 + "--ignore=tests/test_resolver.py" + "--ignore=tests/test_search.py" + ]; meta = with lib; { description = "Powerful and Lightweight Python Tree Data Structure";