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