[issue25900] unittest ignores the first ctrl-c when it shouldn't

2016-03-13 Thread Robert Collins
Robert Collins added the comment: I'd rather make this super simple: just terminate the test run immediately. We can catch KeyBoardInterrupt in the UI layer to still permit outputting summary information. That removes one more source of global state that makes testing fragile. --

[issue25900] unittest ignores the first ctrl-c when it shouldn't

2015-12-22 Thread Marius Gedminas
Marius Gedminas added the comment: Somewhat unrelated nitpick: I'm not very happy that _InterruptHandler doesn't return early after calling the original handler. It's all very well, if the original handler raises or does nothing at all, but if it's a user-installed handler that does something

[issue25900] unittest ignores the first ctrl-c when it shouldn't

2015-12-22 Thread Marius Gedminas
Marius Gedminas added the comment: Here's an updated patch with tests -- Added file: http://bugs.python.org/file41383/dont-ignore-first-ctrl-c-with-tests.patch ___ Python tracker

[issue25900] unittest ignores the first ctrl-c when it shouldn't

2015-12-22 Thread Marius Gedminas
Marius Gedminas added the comment: I looked for any existing tests (by grepping for 'signals' and 'import' on the same line), didn't find any (because my assumption that 'signals' would have to be explicitly imported was wrong). Wrote some new tests, which made me also make some further

[issue25900] unittest ignores the first ctrl-c when it shouldn't

2015-12-21 Thread Michael Foord
Michael Foord added the comment: Suggested behaviour sounds good, patch looks sensible. Is it possible to add a test too? -- ___ Python tracker ___

[issue25900] unittest ignores the first ctrl-c when it shouldn't

2015-12-18 Thread Marius Gedminas
New submission from Marius Gedminas: 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

[issue25900] unittest ignores the first ctrl-c when it shouldn't

2015-12-18 Thread R. David Murray
Changes by R. David Murray : -- nosy: +michael.foord, rbcollins ___ Python tracker ___