No subject


Fri Feb 17 01:35:15 PST 2017


from due to any unhandled exception?

I saw a hook "pytest_exception_interact" But this hook is not meant for
these purposes and even otherwise this will be called even for exceptions
that i have handled inside the TestCase.

The "pytest_runtest_protocol"  description says that "*implements the
runtest_setup/call/teardown protocol for the given test item, including
capturing exceptions and calling reporting hooks.*"

But I wasnt able to find any examples how to do that..

Anjy pointers on how to proceed?


--=20
=E0=AE=85=E0=AE=A9=E0=AF=8D=E0=AE=AA=E0=AF=81=E0=AE=9F=E0=AE=A9=E0=AF=8D,
=E0=AE=AA=E0=AE=BE. =E0=AE=85=E0=AE=B0=E0=AF=81=E0=AE=A3=E0=AF=8D =E0=AE=95=
=E0=AE=BE=E0=AE=B3=E0=AE=BF =E0=AE=B0=E0=AE=BE=E0=AE=9A=E0=AE=BE
_______________________________________________
testing-in-python mailing list
testing-in-python at lists.idyll.org
http://lists.idyll.org/listinfo/testing-in-python

--001a113f1a428393920548b933d2
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr" class=3D"gmail_msg">Hi,<div class=3D"gmai=
l_msg"><br class=3D"gmail_msg"></div><div class=3D"gmail_msg">I suspect pyt=
est_exception_interact will not be called for TestCase subclasses (unittest=
 style), only for normal test functions/methods (but I might be wrong).</di=
v><div class=3D"gmail_msg"><br></div><div class=3D"gmail_msg">pytest_runtes=
t_protocol is one option if you want to analyze the report after a test has=
 been executed.</div><div class=3D"gmail_msg"><br></div><div class=3D"gmail=
_msg">Can you provide some example code which illustrates what you are tryi=
ng to accomplish?=C2=A0</div><div class=3D"gmail_msg"><br></div><div class=
=3D"gmail_msg">Cheers,</div><div class=3D"gmail_msg"><br class=3D"gmail_msg=
"></div><div class=3D"gmail_msg"><br class=3D"gmail_msg"></div></div><br cl=
ass=3D"gmail_msg"><div class=3D"gmail_quote gmail_msg"><div dir=3D"ltr" cla=
ss=3D"gmail_msg">On Fri, Feb 17, 2017 at 7:37 AM arun kali raja &lt;<a href=
=3D"mailto:arunsep886 at gmail.com" class=3D"gmail_msg" target=3D"_blank">arun=
sep886 at gmail.com</a>&gt; wrote:<br class=3D"gmail_msg"></div><blockquote cl=
ass=3D"gmail_quote gmail_msg" style=3D"margin:0 0 0 .8ex;border-left:1px #c=
cc solid;padding-left:1ex"><div dir=3D"ltr" class=3D"gmail_msg">Hi,<div cla=
ss=3D"gmail_msg"><br class=3D"gmail_msg"></div><div class=3D"gmail_msg">Say=
 i have a TestCase that doesnt assert when an exception is raised in certai=
n cases... The Testcase execution will stop when ever the exception is rais=
ed.</div><div class=3D"gmail_msg"><br class=3D"gmail_msg"></div><div class=
=3D"gmail_msg">From any of the pytest hooks can i know if the TestCase exec=
ution stopped from due to any unhandled exception?</div><div class=3D"gmail=
_msg"><br class=3D"gmail_msg"></div><div class=3D"gmail_msg">I saw a hook &=
quot;<span style=3D"background-color:rgb(250,243,232);color:rgb(62,67,73);f=
ont-family:consolas,menlo,&quot;deja vu sans mono&quot;,&quot;bitstream ver=
a sans mono&quot;,monospace;font-size:20.4px;font-weight:bold" class=3D"gma=
il_msg">pytest_exception_interact&quot;=C2=A0</span>But this hook is not me=
ant for these purposes and even otherwise this will be called even for exce=
ptions that i have handled inside the TestCase.</div><div class=3D"gmail_ms=
g"><br class=3D"gmail_msg"></div><div class=3D"gmail_msg">The &quot;<span s=
tyle=3D"color:rgb(62,67,73);font-family:consolas,menlo,&quot;deja vu sans m=
ono&quot;,&quot;bitstream vera sans mono&quot;,monospace;font-size:20.4px;f=
ont-weight:bold" class=3D"gmail_msg">pytest_runtest_protocol&quot; =C2=A0</=
span>description says that &quot;<span style=3D"color:rgb(62,67,73);font-fa=
mily:sans-serif" class=3D"gmail_msg"><i class=3D"gmail_msg">implements the =
runtest_setup/call/teardown protocol for the given test item, including cap=
turing exceptions and calling reporting hooks.</i><span style=3D"font-size:=
17px" class=3D"gmail_msg">&quot;=C2=A0</span><br class=3D"gmail_msg"><br cl=
ass=3D"gmail_msg"></span>But I wasnt able to find any examples how to do th=
at..</div><div class=3D"gmail_msg"><br class=3D"gmail_msg"></div><div class=
=3D"gmail_msg">Anjy pointers on how to proceed?</div><div class=3D"gmail_ms=
g"><br class=3D"gmail_msg"></div><div class=3D"gmail_msg"><br class=3D"gmai=
l_msg"></div><div class=3D"gmail_msg">--=C2=A0<br class=3D"gmail_msg"></div=
><div class=3D"gmail_msg"><div class=3D"m_-8177079920803864204m_73901047829=
34737426gmail_signature gmail_msg">=E0=AE=85=E0=AE=A9=E0=AF=8D=E0=AE=AA=E0=
=AF=81=E0=AE=9F=E0=AE=A9=E0=AF=8D,<br class=3D"gmail_msg">
=E0=AE=AA=E0=AE=BE. =E0=AE=85=E0=AE=B0=E0=AF=81=E0=AE=A3=E0=AF=8D =E0=AE=95=
=E0=AE=BE=E0=AE=B3=E0=AE=BF =E0=AE=B0=E0=AE=BE=E0=AE=9A=E0=AE=BE </div>
</div></div>
_______________________________________________<br class=3D"gmail_msg">
testing-in-python mailing list<br class=3D"gmail_msg">
<a href=3D"mailto:testing-in-python at lists.idyll.org" class=3D"gmail_msg" ta=
rget=3D"_blank">testing-in-python at lists.idyll.org</a><br class=3D"gmail_msg=
">
<a href=3D"http://lists.idyll.org/listinfo/testing-in-python" rel=3D"norefe=
rrer" class=3D"gmail_msg" target=3D"_blank">http://lists.idyll.org/listinfo=
/testing-in-python</a><br class=3D"gmail_msg">
</blockquote></div></div>

--001a113f1a428393920548b933d2--



More information about the testing-in-python mailing list