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
29dcdabf
Commit
29dcdabf
authored
Dec 08, 2009
by
Antoine Pitrou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make test_pipes a little bit more robust.
parent
ca173e2a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
Lib/test/test_pipes.py
Lib/test/test_pipes.py
+6
-3
No files found.
Lib/test/test_pipes.py
View file @
29dcdabf
...
...
@@ -2,7 +2,7 @@ import pipes
import
os
import
string
import
unittest
from
test.test_support
import
TESTFN
,
run_unittest
,
unlink
from
test.test_support
import
TESTFN
,
run_unittest
,
unlink
,
reap_children
if
os
.
name
!=
'posix'
:
raise
unittest
.
SkipTest
(
'pipes module only works on posix'
)
...
...
@@ -36,7 +36,8 @@ class SimplePipeTests(unittest.TestCase):
file
(
TESTFN
,
'w'
).
write
(
'hello world #2'
)
t
=
pipes
.
Template
()
t
.
append
(
s_command
+
' < $IN'
,
pipes
.
FILEIN_STDOUT
)
self
.
assertEqual
(
t
.
open
(
TESTFN
,
'r'
).
read
(),
'HELLO WORLD #2'
)
with
t
.
open
(
TESTFN
,
'r'
)
as
f
:
self
.
assertEqual
(
f
.
read
(),
'HELLO WORLD #2'
)
def
testEmptyPipeline1
(
self
):
# copy through empty pipe
...
...
@@ -52,7 +53,8 @@ class SimplePipeTests(unittest.TestCase):
d
=
'empty pipeline test READ'
file
(
TESTFN
,
'w'
).
write
(
d
)
t
=
pipes
.
Template
()
self
.
assertEqual
(
t
.
open
(
TESTFN
,
'r'
).
read
(),
d
)
with
t
.
open
(
TESTFN
,
'r'
)
as
f
:
self
.
assertEqual
(
f
.
read
(),
d
)
def
testEmptyPipeline3
(
self
):
# write through empty pipe
...
...
@@ -185,6 +187,7 @@ class SimplePipeTests(unittest.TestCase):
def
test_main
():
run_unittest
(
SimplePipeTests
)
reap_children
()
if
__name__
==
"__main__"
:
test_main
()
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