How do I test Python programs with signal handlers (e.g., SIGUSR1, SIGINT, etc.)?

Running signal-based unit tests makes the GitHub Actions to hang or terminate prematurely.
The test suite works perfectly fine on local environments, specifically, when executed from a shell prompt.
Is there any way to let my test suite to run as a separate process group or session, so that intentionally raised signals are delivered to only the test program, not the action runner?


On GitHub Actions workflow, we seem have no available easy methods to do that. There are not any actions for signal-based unit tests can be found on the GitHub Marketplace.

Maybe there’s a different way to test signal handling?