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.
This commit is contained in:
Drew Risinger 2020-09-12 11:29:32 -04:00
parent 7b3cbc600f
commit 1d86636aca
1 changed files with 10 additions and 12 deletions

View File

@ -1,13 +1,15 @@
{ lib { lib
, buildPythonPackage , buildPythonPackage
, fetchPypi , fetchPypi
, pythonOlder
, substituteAll , substituteAll
, fetchpatch
, nose
, six , six
, withGraphviz ? true , withGraphviz ? true
, graphviz , graphviz
, fontconfig , fontconfig
# Tests
, pytestCheckHook
, nose
}: }:
buildPythonPackage rec { buildPythonPackage rec {
@ -26,10 +28,6 @@ buildPythonPackage rec {
}) })
]; ];
checkInputs = [
nose
];
propagatedBuildInputs = [ propagatedBuildInputs = [
six six
]; ];
@ -42,13 +40,13 @@ buildPythonPackage rec {
# circular dependency anytree → graphviz → pango → glib → gtk-doc → anytree # circular dependency anytree → graphviz → pango → glib → gtk-doc → anytree
doCheck = withGraphviz; doCheck = withGraphviz;
checkPhase = '' checkInputs = [ pytestCheckHook nose ];
runHook preCheck
nosetests pytestFlagsArray = lib.optionals (pythonOlder "3.4") [
# Use enums, which aren't available pre-python3.4
runHook postCheck "--ignore=tests/test_resolver.py"
''; "--ignore=tests/test_search.py"
];
meta = with lib; { meta = with lib; {
description = "Powerful and Lightweight Python Tree Data Structure"; description = "Powerful and Lightweight Python Tree Data Structure";