From b1eeba1cd70d6735578cab5e2363c8de653de022 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Wed, 6 Apr 2016 16:30:08 +1000 Subject: Stop comparing repr()'s in TestEntryPoint In Python 3, the default order of iterables can not determined, so comparing the repr of objects that include tuples is not static like it is under Python 2. Compare the attributes of EntryPoint instead, making sure to sort .attrs and .extras. Closes: #526 --- pkg_resources/tests/test_resources.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'pkg_resources') diff --git a/pkg_resources/tests/test_resources.py b/pkg_resources/tests/test_resources.py index 7f86c797..f7ddef55 100644 --- a/pkg_resources/tests/test_resources.py +++ b/pkg_resources/tests/test_resources.py @@ -382,7 +382,10 @@ class TestEntryPoints: def checkSubMap(self, m): assert len(m) == len(self.submap_expect) for key, ep in self.submap_expect.items(): - assert repr(m.get(key)) == repr(ep) + assert m.get(key).name == ep.name + assert m.get(key).module_name == ep.module_name + assert sorted(m.get(key).attrs) == sorted(ep.attrs) + assert sorted(m.get(key).extras) == sorted(ep.extras) submap_expect = dict( feature1=EntryPoint('feature1', 'somemodule', ['somefunction']), -- cgit v1.2.3