summaryrefslogtreecommitdiff
path: root/pkg_resources/tests/test_resources.py
diff options
context:
space:
mode:
authorSteve Kowalik <steven@wedontsleep.org>2016-04-06 16:30:08 +1000
committerSteve Kowalik <steven@wedontsleep.org>2016-04-06 16:30:08 +1000
commitb1eeba1cd70d6735578cab5e2363c8de653de022 (patch)
treed84107a160c8736e30556fbcda3eaf66dcd26203 /pkg_resources/tests/test_resources.py
parenta31716f5a86061d7409b8c08154d3b52ff324efd (diff)
downloadpython-setuptools-git-b1eeba1cd70d6735578cab5e2363c8de653de022.tar.gz
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
Diffstat (limited to 'pkg_resources/tests/test_resources.py')
-rw-r--r--pkg_resources/tests/test_resources.py5
1 files changed, 4 insertions, 1 deletions
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']),