Add Session.__repr__

This commit is contained in:
Daniel Hahler 2019-03-24 11:01:22 +01:00
parent 15d608867d
commit aa0b657e58
1 changed files with 9 additions and 0 deletions

View File

@ -441,6 +441,15 @@ class Session(nodes.FSCollector):
self.config.pluginmanager.register(self, name="session") self.config.pluginmanager.register(self, name="session")
def __repr__(self):
return "<%s %s exitstatus=%r testsfailed=%d testscollected=%d>" % (
self.__class__.__name__,
self.name,
getattr(self, "exitstatus", "<UNSET>"),
self.testsfailed,
self.testscollected,
)
def _node_location_to_relpath(self, node_path): def _node_location_to_relpath(self, node_path):
# bestrelpath is a quite slow function # bestrelpath is a quite slow function
return self._bestrelpathcache[node_path] return self._bestrelpathcache[node_path]