Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nemu3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
nemu3
Commits
cdeed82e
Commit
cdeed82e
authored
Apr 02, 2012
by
Martín Ferrari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid the warning when testing forceful kills of processes.
parent
aa353b5e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
test/test_subprocess.py
test/test_subprocess.py
+8
-2
No files found.
test/test_subprocess.py
View file @
cdeed82e
...
...
@@ -200,7 +200,11 @@ class TestSubprocess(unittest.TestCase):
os
.
close
(
r
)
pid
=
p
.
pid
os
.
kill
(
pid
,
0
)
# verify process still there
# Avoid the warning about the process being killed
orig_stderr
=
sys
.
stderr
sys
.
stderr
=
open
(
"/dev/null"
,
"w"
)
p
.
destroy
()
sys
.
stderr
=
orig_stderr
self
.
assertRaises
(
OSError
,
os
.
kill
,
pid
,
0
)
# should be dead by now
p
=
node
.
Subprocess
([
'sleep'
,
'100'
])
...
...
@@ -249,14 +253,16 @@ class TestSubprocess(unittest.TestCase):
p
=
node
.
Popen
(
'cat'
,
stdin
=
sp
.
PIPE
)
self
.
assertEquals
(
p
.
communicate
(),
(
None
,
None
))
p
=
node
.
Popen
(
'cat >&2'
,
shell
=
True
,
stdin
=
sp
.
PIPE
,
stderr
=
sp
.
PIPE
)
p
=
node
.
Popen
(
'cat >&2'
,
shell
=
True
,
stdin
=
sp
.
PIPE
,
stderr
=
sp
.
PIPE
)
p
.
stdin
.
write
(
"hello world
\
n
"
)
p
.
stdin
.
close
()
self
.
assertEquals
(
p
.
stderr
.
readlines
(),
[
"hello world
\
n
"
])
self
.
assertEquals
(
p
.
stdout
,
None
)
self
.
assertEquals
(
p
.
wait
(),
0
)
p
=
node
.
Popen
([
'sh'
,
'-c'
,
'cat >&2'
],
stdin
=
sp
.
PIPE
,
stderr
=
sp
.
PIPE
)
p
=
node
.
Popen
([
'sh'
,
'-c'
,
'cat >&2'
],
stdin
=
sp
.
PIPE
,
stderr
=
sp
.
PIPE
)
self
.
assertEquals
(
p
.
communicate
(
_longstring
),
(
None
,
_longstring
))
#
...
...
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