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
24b447ed
Commit
24b447ed
authored
Sep 23, 2018
by
Serhiy Storchaka
Committed by
GitHub
Sep 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use in-memory streams instead of NamedTemporaryFile. (GH-9508)
parent
17b1d5d4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
Lib/distutils/tests/test_log.py
Lib/distutils/tests/test_log.py
+6
-4
No files found.
Lib/distutils/tests/test_log.py
View file @
24b447ed
"""Tests for distutils.log"""
import
io
import
sys
import
unittest
from
tempfile
import
NamedTemporaryFile
from
test.support
import
swap_attr
,
run_unittest
from
distutils
import
log
...
...
@@ -14,9 +14,11 @@ class TestLog(unittest.TestCase):
# output as is.
for
errors
in
(
'strict'
,
'backslashreplace'
,
'surrogateescape'
,
'replace'
,
'ignore'
):
with
self
.
subTest
(
errors
=
errors
),
\
NamedTemporaryFile
(
"w+"
,
encoding
=
'cp437'
,
errors
=
errors
)
as
stdout
,
\
NamedTemporaryFile
(
"w+"
,
encoding
=
'cp437'
,
errors
=
errors
)
as
stderr
:
with
self
.
subTest
(
errors
=
errors
):
stdout
=
io
.
TextIOWrapper
(
io
.
BytesIO
(),
encoding
=
'cp437'
,
errors
=
errors
)
stderr
=
io
.
TextIOWrapper
(
io
.
BytesIO
(),
encoding
=
'cp437'
,
errors
=
errors
)
old_threshold
=
log
.
set_threshold
(
log
.
DEBUG
)
try
:
with
swap_attr
(
sys
,
'stdout'
,
stdout
),
\
...
...
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