Kaydet (Commit) b8f22b14 authored tarafından Florent Xicluna's avatar Florent Xicluna

Merged revisions 78673 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r78673 | florent.xicluna | 2010-03-05 02:05:55 +0100 (ven, 05 mar 2010) | 2 lines

  Let's use assertIsNone / assertIsNotNone. It's hype.
........
üst 6f666485
...@@ -653,17 +653,16 @@ class POSIXProcessTestCase(unittest.TestCase): ...@@ -653,17 +653,16 @@ class POSIXProcessTestCase(unittest.TestCase):
# Let the process initialize correctly (Issue #3137) # Let the process initialize correctly (Issue #3137)
time.sleep(0.1) time.sleep(0.1)
self.assertIs(p.poll(), None) self.assertIsNone(p.poll())
count, maxcount = 0, 3 count, maxcount = 0, 3
# Retry if the process do not receive the SIGINT signal. # Retry if the process do not receive the SIGINT signal.
while count < maxcount and p.poll() is None: while count < maxcount and p.poll() is None:
p.send_signal(signal.SIGINT) p.send_signal(signal.SIGINT)
time.sleep(0.1) time.sleep(0.1)
count += 1 count += 1
if p.poll() is None: self.assertIsNotNone(p.poll(), "the subprocess did not receive "
raise support.TestFailed("the subprocess did not receive "
"the signal SIGINT") "the signal SIGINT")
elif count > 1: if count > 1:
print("p.send_signal(SIGINT) succeeded " print("p.send_signal(SIGINT) succeeded "
"after {} attempts".format(count), file=sys.stderr) "after {} attempts".format(count), file=sys.stderr)
self.assertNotEqual(p.wait(), 0) self.assertNotEqual(p.wait(), 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment