Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b8f22b1

Browse files
committed
Merged revisions 78673 via svnmerge from
svn+ssh://[email protected]/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. ........
1 parent 6f66648 commit b8f22b1

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

Lib/test/test_subprocess.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -653,17 +653,16 @@ def test_send_signal(self):
653653

654654
# Let the process initialize correctly (Issue #3137)
655655
time.sleep(0.1)
656-
self.assertIs(p.poll(), None)
656+
self.assertIsNone(p.poll())
657657
count, maxcount = 0, 3
658658
# Retry if the process do not receive the SIGINT signal.
659659
while count < maxcount and p.poll() is None:
660660
p.send_signal(signal.SIGINT)
661661
time.sleep(0.1)
662662
count += 1
663-
if p.poll() is None:
664-
raise support.TestFailed("the subprocess did not receive "
665-
"the signal SIGINT")
666-
elif count > 1:
663+
self.assertIsNotNone(p.poll(), "the subprocess did not receive "
664+
"the signal SIGINT")
665+
if count > 1:
667666
print("p.send_signal(SIGINT) succeeded "
668667
"after {} attempts".format(count), file=sys.stderr)
669668
self.assertNotEqual(p.wait(), 0)

0 commit comments

Comments
 (0)