bpo-31904: Support signal module on VxWorks (GH-23391)
diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py
index 5a8ff36..6a43fe7 100644
--- a/Lib/test/test_signal.py
+++ b/Lib/test/test_signal.py
@@ -519,10 +519,14 @@ def handler(signum, frame):
else:
write.setblocking(False)
- # Start with large chunk size to reduce the
- # number of send needed to fill the buffer.
written = 0
- for chunk_size in (2 ** 16, 2 ** 8, 1):
+ if sys.platform == "vxworks":
+ CHUNK_SIZES = (1,)
+ else:
+ # Start with large chunk size to reduce the
+ # number of send needed to fill the buffer.
+ CHUNK_SIZES = (2 ** 16, 2 ** 8, 1)
+ for chunk_size in CHUNK_SIZES:
chunk = b"x" * chunk_size
try:
while True:
@@ -595,6 +599,7 @@ def handler(signum, frame):
@unittest.skipIf(sys.platform == "win32", "Not valid on Windows")
+@unittest.skipUnless(hasattr(signal, 'siginterrupt'), "needs signal.siginterrupt()")
class SiginterruptTest(unittest.TestCase):
def readpipe_interrupted(self, interrupt):
@@ -680,6 +685,8 @@ def test_siginterrupt_off(self):
@unittest.skipIf(sys.platform == "win32", "Not valid on Windows")
+@unittest.skipUnless(hasattr(signal, 'getitimer') and hasattr(signal, 'setitimer'),
+ "needs signal.getitimer() and signal.setitimer()")
class ItimerTest(unittest.TestCase):
def setUp(self):
self.hndl_called = False