how to suppress python stack trace?

522 views
Skip to first unread message

Bryan Oakley

unread,
May 21, 2012, 5:50:35 PM5/21/12
to robotframework-devel
Is there any way to turn off the automatic DEBUG stack trace when a python keyword fails?

I have a python keyword that does nothing but call a .NET function. When it fails, I get 16 lines of useless python traceback. I want to be able to turn that off just for this keyword (or, more accurately, a family of keywords)

I'm not asking to turn the feature off completely; I'm just wondering if there's a global variable I can set, or a special exception I can throw, that disables the stacktrace only for one specific library keyword.


Bryan Oakley

unread,
May 21, 2012, 6:24:16 PM5/21/12
to Bill Hayes, robotframework-devel
No, because I must throw an exception for robot to treat it as a failure. 

--bryan


On May 21, 2012, at 4:55 PM, Bill Hayes <bhay...@gmail.com> wrote:

If you put your call in a try/except statement with just a 'pass' in the except
part, wouldn't that do what you need?

Bill Hayes



--
You received this message because you are subscribed to the Google Groups "robotframework-devel" group.
To post to this group, send email to robotframe...@googlegroups.com.
To unsubscribe from this group, send email to robotframework-d...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/robotframework-devel?hl=en.

Pekka Klärck

unread,
May 22, 2012, 3:41:26 AM5/22/12
to bryan....@gmail.com, robotframework-devel
2012/5/22 Bryan Oakley <bryan....@gmail.com>:
> Is there any way to turn off the automatic DEBUG stack trace when a python
> keyword fails?

On Robot side there is no such functionality.

> I have a python keyword that does nothing but call a .NET function. When it
> fails, I get 16 lines of useless python traceback. I want to be able to turn
> that off just for this keyword (or, more accurately, a family of keywords)

Could you just catch the exception and raise a new one with its
message but without a traceback?

By the way, is this related to your generic Python wrapper for C#
libraries? Any change you could release it as an open source project
on GitHub or elsewhere? I'm sure others would find if useful and it
could also be used as a base if native C# library support is
implemented to the framework.

Cheers,
.peke
--
Agile Tester/Developer/Consultant :: http://eliga.fi
Lead Developer of Robot Framework :: http://robotframework.org
Reply all
Reply to author
Forward
0 new messages