diff --git a/py/test/collect.py b/py/test/collect.py index f6d37dc7b..40198e3f0 100644 --- a/py/test/collect.py +++ b/py/test/collect.py @@ -65,10 +65,8 @@ class Collector(object): return "<%s %r>" %(self.__class__.__name__, self.name) def __eq__(self, other): - #try: - # return self.name == other.name and self.parent == other.parent - #except AttributeError: - # return False + # XXX a rather strict check for now to not confuse + # the SetupState.prepare() logic return self is other def __hash__(self): @@ -359,7 +357,7 @@ class Module(FSCollector, PyCollectorMixin): if res is None: attr = getattr(self.obj, name, None) if attr is not None: - return self.makeitem(name, attr, usefilters=False) + res = self.makeitem(name, attr, usefilters=False) return res def startcapture(self): diff --git a/py/test/testing/test_config.py b/py/test/testing/test_config.py index c60dd36eb..4da5fb037 100644 --- a/py/test/testing/test_config.py +++ b/py/test/testing/test_config.py @@ -397,8 +397,7 @@ class TestConfigColitems: assert trail[0] == a.relto(config.topdir) assert trail[1] == ('trail.py',) col2 = config._getcollector(trail) - assert [i.name for i in col2.listchain()] == \ - [i.name for i in col.listchain()] + assert col2.listnames() == col.listnames() def test_get_collector_trail_topdir_and_beyond(self): config = py.test.config._reparse([self.tmpdir])