Skip to content

Commit 2dfb52f

Browse files
fix rebase artifacts
1 parent cc6eb9f commit 2dfb52f

File tree

2 files changed

+10
-46
lines changed

2 files changed

+10
-46
lines changed

src/_pytest/reports.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ def getslaveinfoline(node):
99
d = node.slaveinfo
1010
ver = "%s.%s.%s" % d["version_info"][:3]
1111
node._slaveinfocache = s = "[%s] %s -- Python %s %s" % (
12-
d["id"], d["sysplatform"], ver, d["executable"]
12+
d["id"],
13+
d["sysplatform"],
14+
ver,
15+
d["executable"],
1316
)
1417
return s
1518

1619

1720
class BaseReport(object):
18-
1921
def __init__(self, **kw):
2022
self.__dict__.update(kw)
2123

@@ -149,7 +151,9 @@ def __init__(
149151

150152
def __repr__(self):
151153
return "<TestReport %r when=%r outcome=%r>" % (
152-
self.nodeid, self.when, self.outcome
154+
self.nodeid,
155+
self.when,
156+
self.outcome,
153157
)
154158

155159

@@ -164,7 +168,6 @@ def __init__(self, longrepr, **extra):
164168

165169

166170
class CollectReport(BaseReport):
167-
168171
def __init__(self, nodeid, outcome, longrepr, result, sections=(), **extra):
169172
self.nodeid = nodeid
170173
self.outcome = outcome
@@ -179,12 +182,13 @@ def location(self):
179182

180183
def __repr__(self):
181184
return "<CollectReport %r lenresult=%s outcome=%r>" % (
182-
self.nodeid, len(self.result), self.outcome
185+
self.nodeid,
186+
len(self.result),
187+
self.outcome,
183188
)
184189

185190

186191
class CollectErrorRepr(TerminalRepr):
187-
188192
def __init__(self, msg):
189193
self.longrepr = msg
190194

src/_pytest/runner.py

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -257,46 +257,6 @@ def pytest_runtest_makereport(item, call):
257257
)
258258

259259

260-
def pytest_runtest_makereport(item, call):
261-
when = call.when
262-
duration = call.stop - call.start
263-
keywords = {x: 1 for x in item.keywords}
264-
excinfo = call.excinfo
265-
sections = []
266-
if not call.excinfo:
267-
outcome = "passed"
268-
longrepr = None
269-
else:
270-
if not isinstance(excinfo, ExceptionInfo):
271-
outcome = "failed"
272-
longrepr = excinfo
273-
elif excinfo.errisinstance(skip.Exception):
274-
outcome = "skipped"
275-
r = excinfo._getreprcrash()
276-
longrepr = (str(r.path), r.lineno, r.message)
277-
else:
278-
outcome = "failed"
279-
if call.when == "call":
280-
longrepr = item.repr_failure(excinfo)
281-
else: # exception in setup or teardown
282-
longrepr = item._repr_failure_py(
283-
excinfo, style=item.config.option.tbstyle
284-
)
285-
for rwhen, key, content in item._report_sections:
286-
sections.append(("Captured %s %s" % (key, rwhen), content))
287-
return TestReport(
288-
item.nodeid,
289-
item.location,
290-
keywords,
291-
outcome,
292-
longrepr,
293-
when,
294-
sections,
295-
duration,
296-
user_properties=item.user_properties,
297-
)
298-
299-
300260
def pytest_make_collect_report(collector):
301261
call = CallInfo(lambda: list(collector.collect()), "collect")
302262
longrepr = None

0 commit comments

Comments
 (0)