[issue19899] No test for thread.interrupt_main()

2021-10-21 Thread Christian Heimes
Christian Heimes added the comment: Tests have been added as part of GH-24755. -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker

[issue19899] No test for thread.interrupt_main()

2016-11-04 Thread R. David Murray
R. David Murray added the comment: This looks great, thanks. -- stage: needs patch -> commit review ___ Python tracker ___

[issue19899] No test for thread.interrupt_main()

2016-11-04 Thread Charlie Proctor
Charlie Proctor added the comment: I broke the two cases (interrupt_main from test thread and from sub-thread) into two separate tests, using an "expect_sigint" helper. Let me know what you think -- thanks! -- Added file: http://bugs.python.org/file45354/test_interrupt_main.patch

[issue19899] No test for thread.interrupt_main()

2016-11-04 Thread R. David Murray
R. David Murray added the comment: Ah, of course. The revised comments look good. I think I'd rather see the two cases tested separately, but if they are kept as one another comment ("lock was successfully released; reacquire the lock and test that it also works from a sub-thread") might be

[issue19899] No test for thread.interrupt_main()

2016-11-04 Thread Charlie Proctor
Charlie Proctor added the comment: To clarify further, the SIGALRM handler catches the timeout sent by the ITIMER_REAL... whereas the SIGINT handler catches the interrupt_main() signals. -- ___ Python tracker

[issue19899] No test for thread.interrupt_main()

2016-11-04 Thread Charlie Proctor
Charlie Proctor added the comment: Thanks for the feedback David! I've posted a revised patch with more descriptive comments and the restoration code moved into addCleanup. As described in the comments, in the context of this test, the "main" thread is the one running the test suite... so

[issue19899] No test for thread.interrupt_main()

2016-11-04 Thread R. David Murray
R. David Murray added the comment: Thanks, Charlie. You should use addCleanup to handle the resetting of the state, so that it gets cleaned up no matter what happens in the test. IMO the comments should either be omitted or be more descriptive about what exactly is being tested. For

[issue19899] No test for thread.interrupt_main()

2016-11-04 Thread Charlie Proctor
Charlie Proctor added the comment: Found this through the "Random Issue" button -- I've uploaded a simple test case for thread.interrupt_main(). This is my first patch :) So let me know if there's something else I should do and I'd love to hear any feedback... -- keywords: +patch

[issue19899] No test for thread.interrupt_main()

2013-12-05 Thread Christian Heimes
New submission from Christian Heimes: Accoring to LCOV thread_PyThread_interrupt_main() is never called by any test. It's only referenced by some idle code. http://tiran.bitbucket.org/python-lcov/Modules/_threadmodule.c.gcov.html#1110 -- messages: 205306 nosy: christian.heimes