Skip to content

Commit 4142c41

Browse files
authored
Merge pull request #4990 from blueyed/session-repr
Session repr
2 parents 15d6088 + aa0b657 commit 4142c41

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/_pytest/main.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,15 @@ def __init__(self, config):
441441

442442
self.config.pluginmanager.register(self, name="session")
443443

444+
def __repr__(self):
445+
return "<%s %s exitstatus=%r testsfailed=%d testscollected=%d>" % (
446+
self.__class__.__name__,
447+
self.name,
448+
getattr(self, "exitstatus", "<UNSET>"),
449+
self.testsfailed,
450+
self.testscollected,
451+
)
452+
444453
def _node_location_to_relpath(self, node_path):
445454
# bestrelpath is a quite slow function
446455
return self._bestrelpathcache[node_path]

0 commit comments

Comments
 (0)