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.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py
index 0ddfe367188..0e1d06706d6 100644
--- a/Lib/test/test_signal.py
+++ b/Lib/test/test_signal.py
@@ -608,6 +608,15 @@ class ItimerTest(unittest.TestCase):
# and the handler should have been called
self.assertEqual(self.hndl_called, True)
+ def test_setitimer_tiny(self):
+ # bpo-30807: C setitimer() takes a microsecond-resolution interval.
+ # Check that float -> timeval conversion doesn't round
+ # the interval down to zero, which would disable the timer.
+ self.itimer = signal.ITIMER_REAL
+ signal.setitimer(self.itimer, 1e-6)
+ time.sleep(1)
+ self.assertEqual(self.hndl_called, True)
+
class PendingSignalsTests(unittest.TestCase):
"""