This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mgedmin
Recipients mgedmin
Date 2015-12-18.08:48:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1450428509.62.0.620097682631.issue25900@psf.upfronthosting.co.za>
In-reply-to
Content
unittest.signals._InterruptHandler is very nice: on first ^C it tells any registered unittest Result instances to gracefully stop the test run, and on any subsequent ^C it defers to the default interrupt handler, which immediately terminates the test run (possibly without giving it a chance to output summary information).

This doesn't work very well when a test runner forgets to register the Result instance: the first ^C is then quietly ignored.  (See https://github.com/django-nose/django-nose/issues/252 for an example.)

Suggestion: if there are no registered results in the unittest.signals._results dict, don't silently ignore the first ^C.  Instead, immediately defer to the saved interrupt handler.

Since code is often clearer than words, I'm attaching a patch.
History
Date User Action Args
2015-12-18 08:48:29mgedminsetrecipients: + mgedmin
2015-12-18 08:48:29mgedminsetmessageid: <1450428509.62.0.620097682631.issue25900@psf.upfronthosting.co.za>
2015-12-18 08:48:29mgedminlinkissue25900 messages
2015-12-18 08:48:29mgedmincreate