You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nose-users
I want to catch the KeyboardInterrupt exception so that the test
application exits gracefully (i.e. kills sub-processes and suppresses
the default stack trace output) but I can't see a way of doing this.
I considered an ErrorClass plug-in but that doesn't seem to permit
execution of arbitrary code like a clean-up routine.
I have built a normal plug-in that implements stopTest(), however that
requires several Ctrl-C interrupts before it is executed and only
applies when tests are running, whereas I may wish to terminate the
application during the initialisation phase.
Any ideas?
Thanks ...
Richard
Kumar McMillan
unread,
Jan 2, 2008, 2:11:20 PM1/2/08
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nose-...@googlegroups.com
On Jan 2, 2008 5:49 AM, richard <ebiz...@gmail.com> wrote: > > I want to catch the KeyboardInterrupt exception so that the test > application exits gracefully (i.e. kills sub-processes and suppresses > the default stack trace output) but I can't see a way of doing this.
AFAIK, KeyboardInterrupt is purposefully ignored by nose internals everywhere so that the exception can do exactly what the name suggests. Have you considered using atexit.register() to install your cleanup routine?
richard
unread,
Jan 3, 2008, 8:31:09 AM1/3/08
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nose-users
atexit occurs too late. I now use a signal handler based on SIGINT
quite successfully.