mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
Merged revisions 61834,61841-61842,61851-61853,61863-61864,61869-61870,61874,61889 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r61834 | raymond.hettinger | 2008-03-24 07:07:49 +0100 (Mon, 24 Mar 2008) | 1 line Tighten documentation for Random.triangular. ........ r61841 | raymond.hettinger | 2008-03-24 09:17:39 +0100 (Mon, 24 Mar 2008) | 1 line Issue 2460: Make Ellipsis objects copyable. ........ r61842 | georg.brandl | 2008-03-24 10:34:34 +0100 (Mon, 24 Mar 2008) | 2 lines #1700821: add a note to audioop docs about signedness of sample formats. ........ r61851 | christian.heimes | 2008-03-24 20:57:42 +0100 (Mon, 24 Mar 2008) | 1 line Added quick hack for bzr ........ r61852 | christian.heimes | 2008-03-24 20:58:17 +0100 (Mon, 24 Mar 2008) | 1 line Added quick hack for bzr ........ r61853 | amaury.forgeotdarc | 2008-03-24 22:04:10 +0100 (Mon, 24 Mar 2008) | 4 lines Issue2469: Correct a typo I introduced at r61793: compilation error with UCS4 builds. All buildbots compile with UCS2... ........ r61863 | neal.norwitz | 2008-03-25 05:17:38 +0100 (Tue, 25 Mar 2008) | 2 lines Fix a bunch of UnboundLocalErrors when the tests fail. ........ r61864 | neal.norwitz | 2008-03-25 05:18:18 +0100 (Tue, 25 Mar 2008) | 2 lines Try to fix a bunch of compiler warnings on Win64. ........ r61869 | neal.norwitz | 2008-03-25 07:35:10 +0100 (Tue, 25 Mar 2008) | 3 lines Don't try to close a non-open file. Don't let file removal cause the test to fail. ........ r61870 | neal.norwitz | 2008-03-25 08:00:39 +0100 (Tue, 25 Mar 2008) | 7 lines Try to get this test to be more stable: * disable gc during the test run because we are spawning objects and there was an exception when calling Popen.__del__ * Always set an alarm handler so the process doesn't exit if the test fails (should probably add assertions on the value of hndl_called in more places) * Using a negative time causes Linux to treat it as zero, so disable that test. ........ r61874 | gregory.p.smith | 2008-03-25 08:31:28 +0100 (Tue, 25 Mar 2008) | 2 lines Use a 32-bit unsigned int here, a long is not needed. ........ r61889 | georg.brandl | 2008-03-25 12:59:51 +0100 (Tue, 25 Mar 2008) | 2 lines Move declarations to block start. ........
This commit is contained in:
parent
afbc266bb6
commit
cc47b05fe5
12 changed files with 74 additions and 27 deletions
|
@ -1,6 +1,7 @@
|
|||
import unittest
|
||||
from test import test_support
|
||||
from contextlib import closing, nested
|
||||
import gc
|
||||
import pickle
|
||||
import select
|
||||
import signal
|
||||
|
@ -30,6 +31,14 @@ def exit_subprocess():
|
|||
class InterProcessSignalTests(unittest.TestCase):
|
||||
MAX_DURATION = 20 # Entire test should last at most 20 sec.
|
||||
|
||||
def setUp(self):
|
||||
self.using_gc = gc.isenabled()
|
||||
gc.disable()
|
||||
|
||||
def tearDown(self):
|
||||
if self.using_gc:
|
||||
gc.enable()
|
||||
|
||||
def handlerA(self, *args):
|
||||
self.a_called = True
|
||||
if test_support.verbose:
|
||||
|
@ -263,8 +272,10 @@ class ItimerTest(unittest.TestCase):
|
|||
self.hndl_called = False
|
||||
self.hndl_count = 0
|
||||
self.itimer = None
|
||||
self.old_alarm = signal.signal(signal.SIGALRM, self.sig_alrm)
|
||||
|
||||
def tearDown(self):
|
||||
signal.signal(signal.SIGALRM, self.old_alarm)
|
||||
if self.itimer is not None: # test_itimer_exc doesn't change this attr
|
||||
# just ensure that itimer is stopped
|
||||
signal.setitimer(self.itimer, 0)
|
||||
|
@ -303,13 +314,13 @@ class ItimerTest(unittest.TestCase):
|
|||
# XXX I'm assuming -1 is an invalid itimer, but maybe some platform
|
||||
# defines it ?
|
||||
self.assertRaises(signal.ItimerError, signal.setitimer, -1, 0)
|
||||
# negative time
|
||||
self.assertRaises(signal.ItimerError, signal.setitimer,
|
||||
signal.ITIMER_REAL, -1)
|
||||
# Negative times are treated as zero on some platforms.
|
||||
if 0:
|
||||
self.assertRaises(signal.ItimerError,
|
||||
signal.setitimer, signal.ITIMER_REAL, -1)
|
||||
|
||||
def test_itimer_real(self):
|
||||
self.itimer = signal.ITIMER_REAL
|
||||
signal.signal(signal.SIGALRM, self.sig_alrm)
|
||||
signal.setitimer(self.itimer, 1.0)
|
||||
if test_support.verbose:
|
||||
print("\ncall pause()...")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue