aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_signal.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_signal.py')
-rw-r--r--Lib/test/test_signal.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py
index ea13c59ec71..d38992db7b8 100644
--- a/Lib/test/test_signal.py
+++ b/Lib/test/test_signal.py
@@ -116,6 +116,16 @@ class PosixTests(unittest.TestCase):
self.assertNotIn(signal.NSIG, s)
self.assertLess(len(s), signal.NSIG)
+ # gh-91145: Make sure that all SIGxxx constants exposed by the Python
+ # signal module have a number in the [0; signal.NSIG-1] range.
+ for name in dir(signal):
+ if not name.startswith("SIG"):
+ continue
+ with self.subTest(name=name):
+ signum = getattr(signal, name)
+ self.assertGreaterEqual(signum, 0)
+ self.assertLess(signum, signal.NSIG)
+
@unittest.skipUnless(sys.executable, "sys.executable required.")
@support.requires_subprocess()
def test_keyboard_interrupt_exit_code(self):