Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
5b08b4d2
Kaydet (Commit)
5b08b4d2
authored
May 19, 2010
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Oops, add the new test_log.py for distutils test suite (missing part of r81359)
üst
1802d3f3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
test_log.py
Lib/distutils/tests/test_log.py
+36
-0
No files found.
Lib/distutils/tests/test_log.py
0 → 100644
Dosyayı görüntüle @
5b08b4d2
"""Tests for distutils.log"""
import
sys
import
unittest
from
tempfile
import
NamedTemporaryFile
from
distutils
import
log
class
TestLog
(
unittest
.
TestCase
):
def
test_non_ascii
(
self
):
# Issue #8663: test that non-ASCII text is escaped with
# backslashreplace error handler (stream use ASCII encoding and strict
# error handler)
old_stdout
=
sys
.
stdout
old_stderr
=
sys
.
stderr
try
:
log
.
set_threshold
(
log
.
DEBUG
)
with
NamedTemporaryFile
(
mode
=
"w+"
,
encoding
=
'ascii'
)
as
stdout
,
\
NamedTemporaryFile
(
mode
=
"w+"
,
encoding
=
'ascii'
)
as
stderr
:
sys
.
stdout
=
stdout
sys
.
stderr
=
stderr
log
.
debug
(
"debug:
\xe9
"
)
log
.
fatal
(
"fatal:
\xe9
"
)
stdout
.
seek
(
0
)
self
.
assertEquals
(
stdout
.
read
()
.
rstrip
(),
"debug:
\\
xe9"
)
stderr
.
seek
(
0
)
self
.
assertEquals
(
stderr
.
read
()
.
rstrip
(),
"fatal:
\\
xe9"
)
finally
:
sys
.
stdout
=
old_stdout
sys
.
stderr
=
old_stderr
def
test_suite
():
return
unittest
.
makeSuite
(
TestLog
)
if
__name__
==
"__main__"
:
unittest
.
main
(
defaultTest
=
"test_suite"
)
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