Added edge case code for solving issue 10825
This commit is contained in:
parent
13024efd7a
commit
d17646461c
|
@ -340,6 +340,12 @@ class TestReport(BaseReport):
|
|||
str,
|
||||
TerminalRepr,
|
||||
] = None
|
||||
elif call.excinfo and when in ("setup", "teardown"):
|
||||
outcome = "passed"
|
||||
longrepr = excinfo
|
||||
TerminalWriter().write(
|
||||
msg=f"<Warning! You are using '{when}' file in your code>", Yellow=True
|
||||
)
|
||||
else:
|
||||
if not isinstance(excinfo, ExceptionInfo):
|
||||
outcome = "failed"
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
def foo():
|
||||
"""
|
||||
>>> foo()
|
||||
'bar'
|
||||
"""
|
||||
return "bar"
|
||||
|
||||
|
||||
def setup():
|
||||
# """
|
||||
# >>> setup()
|
||||
# 'ban'
|
||||
# """
|
||||
# return "ban"
|
||||
raise RuntimeError("Setup called!!! Oh No")
|
Loading…
Reference in New Issue