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
25d79760
Commit
25d79760
authored
Apr 02, 2010
by
Michael Foord
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unittest tests no longer replace the sys.stdout put in place by regrtest
parent
7c63eee4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
8 deletions
+4
-8
Lib/unittest/result.py
Lib/unittest/result.py
+2
-6
Lib/unittest/test/test_result.py
Lib/unittest/test/test_result.py
+2
-2
No files found.
Lib/unittest/result.py
View file @
25d79760
...
@@ -19,10 +19,6 @@ def failfast(method):
...
@@ -19,10 +19,6 @@ def failfast(method):
return
method
(
self
,
*
args
,
**
kw
)
return
method
(
self
,
*
args
,
**
kw
)
return
inner
return
inner
_std_out
=
sys
.
stdout
_std_err
=
sys
.
stderr
NEWLINE
=
os
.
linesep
NEWLINE
=
os
.
linesep
STDOUT_LINE
=
'%sStdout:%s%%s'
%
(
NEWLINE
,
NEWLINE
)
STDOUT_LINE
=
'%sStdout:%s%%s'
%
(
NEWLINE
,
NEWLINE
)
STDERR_LINE
=
'%sStderr:%s%%s'
%
(
NEWLINE
,
NEWLINE
)
STDERR_LINE
=
'%sStderr:%s%%s'
%
(
NEWLINE
,
NEWLINE
)
...
@@ -89,8 +85,8 @@ class TestResult(object):
...
@@ -89,8 +85,8 @@ class TestResult(object):
error
+=
NEWLINE
error
+=
NEWLINE
self
.
_original_stderr
.
write
(
STDERR_LINE
%
error
)
self
.
_original_stderr
.
write
(
STDERR_LINE
%
error
)
sys
.
stdout
=
_std_
out
sys
.
stdout
=
self
.
_original_std
out
sys
.
stderr
=
_std_
err
sys
.
stderr
=
self
.
_original_std
err
self
.
_stdout_buffer
.
seek
(
0
)
self
.
_stdout_buffer
.
seek
(
0
)
self
.
_stdout_buffer
.
truncate
()
self
.
_stdout_buffer
.
truncate
()
self
.
_stderr_buffer
.
seek
(
0
)
self
.
_stderr_buffer
.
seek
(
0
)
...
...
Lib/unittest/test/test_result.py
View file @
25d79760
...
@@ -422,8 +422,8 @@ class TestOutputBuffering(unittest.TestCase):
...
@@ -422,8 +422,8 @@ class TestOutputBuffering(unittest.TestCase):
result
.
addSuccess
(
self
)
result
.
addSuccess
(
self
)
result
.
stopTest
(
self
)
result
.
stopTest
(
self
)
self
.
assertIs
(
real_out
,
sys
.
stdout
)
self
.
assertIs
(
sys
.
stdout
,
result
.
_original_
stdout
)
self
.
assertIs
(
real_err
,
sys
.
stderr
)
self
.
assertIs
(
sys
.
stderr
,
result
.
_original_
stderr
)
self
.
assertEqual
(
result
.
_original_stdout
.
getvalue
(),
''
)
self
.
assertEqual
(
result
.
_original_stdout
.
getvalue
(),
''
)
self
.
assertEqual
(
result
.
_original_stderr
.
getvalue
(),
''
)
self
.
assertEqual
(
result
.
_original_stderr
.
getvalue
(),
''
)
...
...
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