From 3f412c4be8be58588630c824ad3c58a2ab7f1766 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Thu, 4 May 2017 18:16:47 +0200 Subject: [PATCH] Make tests backwards compatibility with old setuptools Signed-off-by: Christian Heimes --- tests.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests.py b/tests.py index 0786f99..891a09c 100644 --- a/tests.py +++ b/tests.py @@ -363,8 +363,13 @@ def test_get(self): ]) def test_plugins(group, name, cls, dist='custodia.ipa'): ep = pkg_resources.get_entry_info(dist, group, name) + assert ep is not None assert ep.dist.project_name == dist - assert ep.resolve() is cls + if hasattr(ep, 'resolve'): + resolved = ep.resolve() + else: + resolved = ep.load(require=False) + assert resolved is cls @pytest.mark.parametrize('principal,result', [