Use the error longrepr rather than the file path to check

for duplicate errors.
This commit is contained in:
Jonathan Hunt
2013-04-28 16:14:52 -07:00
parent 6c1587a157
commit 26016aefd1

View File

@@ -159,7 +159,7 @@ class DSession:
self.countfailures = 0 self.countfailures = 0
self.maxfail = config.getvalue("maxfail") self.maxfail = config.getvalue("maxfail")
self.queue = queue.Queue() self.queue = queue.Queue()
self._failed_collection_paths = {} self._failed_collection_errors = {}
try: try:
self.terminal = config.pluginmanager.getplugin("terminalreporter") self.terminal = config.pluginmanager.getplugin("terminalreporter")
except KeyError: except KeyError:
@@ -290,10 +290,10 @@ class DSession:
self._failed_slave_collectreport(node, rep) self._failed_slave_collectreport(node, rep)
def _failed_slave_collectreport(self, node, rep): def _failed_slave_collectreport(self, node, rep):
# Check we haven't already seen this report. # Check we haven't already seen this report (from
str_path = str(rep.fspath) # another slave).
if str_path not in self._failed_collection_paths: if rep.longrepr not in self._failed_collection_errors:
self._failed_collection_paths[str_path] = True self._failed_collection_errors[rep.longrepr] = True
self.config.hook.pytest_collectreport(report=rep) self.config.hook.pytest_collectreport(report=rep)
self._handlefailures(rep) self._handlefailures(rep)