Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
db8c5d5a
Commit
db8c5d5a
authored
Feb 23, 2012
by
Vitja Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xmlrunner: Don't overwrite old stdin/stdout
parent
d8860462
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
Cython/Tests/xmlrunner.py
Cython/Tests/xmlrunner.py
+5
-1
No files found.
Cython/Tests/xmlrunner.py
View file @
db8c5d5a
...
...
@@ -97,6 +97,7 @@ class _XMLTestResult(_TextTestResult):
self
.
successes
=
[]
self
.
callback
=
None
self
.
elapsed_times
=
elapsed_times
self
.
output_patched
=
False
def
_prepare_callback
(
self
,
test_info
,
target_list
,
verbose_str
,
short_str
):
...
...
@@ -124,13 +125,16 @@ class _XMLTestResult(_TextTestResult):
"""Replace the stdout and stderr streams with string-based streams
in order to capture the tests' output.
"""
if
not
self
.
output_patched
:
(
self
.
old_stdout
,
self
.
old_stderr
)
=
(
sys
.
stdout
,
sys
.
stderr
)
self
.
output_patched
=
True
(
sys
.
stdout
,
sys
.
stderr
)
=
(
self
.
stdout
,
self
.
stderr
)
=
\
(
StringIO
(),
StringIO
())
def
_restore_standard_output
(
self
):
"Restore the stdout and stderr streams."
(
sys
.
stdout
,
sys
.
stderr
)
=
(
self
.
old_stdout
,
self
.
old_stderr
)
self
.
output_patched
=
False
def
startTest
(
self
,
test
):
"Called before execute each test method."
...
...
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