Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
d6935631
Commit
d6935631
authored
Mar 05, 2010
by
Florent Xicluna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Let's use assertIsNone / assertIsNotNone. It's hype.
parent
80e0e2d2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
Lib/test/test_subprocess.py
Lib/test/test_subprocess.py
+5
-5
No files found.
Lib/test/test_subprocess.py
View file @
d6935631
...
...
@@ -655,17 +655,16 @@ class POSIXProcessTestCase(unittest.TestCase):
# Let the process initialize correctly (Issue #3137)
time
.
sleep
(
0.1
)
self
.
assertIs
(
p
.
poll
(),
None
)
self
.
assertIs
None
(
p
.
poll
()
)
count
,
maxcount
=
0
,
3
# Retry if the process do not receive the SIGINT signal.
while
count
<
maxcount
and
p
.
poll
()
is
None
:
p
.
send_signal
(
signal
.
SIGINT
)
time
.
sleep
(
0.1
)
count
+=
1
if
p
.
poll
()
is
None
:
raise
test_support
.
TestFailed
(
"the subprocess did not receive "
"the signal SIGINT"
)
elif
count
>
1
:
self
.
assertIsNotNone
(
p
.
poll
(),
"the subprocess did not receive "
"the signal SIGINT"
)
if
count
>
1
:
print
>>
sys
.
stderr
,
(
"p.send_signal(SIGINT) succeeded "
"after {} attempts"
.
format
(
count
))
self
.
assertNotEqual
(
p
.
wait
(),
0
)
...
...
@@ -824,6 +823,7 @@ def test_main():
ProcessTestCaseNoPoll
,
HelperFunctionTests
)
unit_tests
=
(
POSIXProcessTestCase
,)
test_support
.
run_unittest
(
*
unit_tests
)
test_support
.
reap_children
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment