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
7529620a
Kaydet (Commit)
7529620a
authored
Kas 05, 2012
tarafından
Andrew Svetlov
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #16218: Fix test for issue again
üst
33f13ee1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
18 deletions
+19
-18
test_cmd_line_script.py
Lib/test/test_cmd_line_script.py
+19
-18
No files found.
Lib/test/test_cmd_line_script.py
Dosyayı görüntüle @
7529620a
...
...
@@ -363,25 +363,26 @@ class CmdLineTest(unittest.TestCase):
self
.
assertTrue
(
text
[
1
]
.
startswith
(
' File '
))
self
.
assertTrue
(
text
[
3
]
.
startswith
(
'NameError'
))
def
test_non_
utf8
(
self
):
def
test_non_
ascii
(
self
):
# Issue #16218
with
temp_dir
()
as
script_dir
:
script_basename
=
'
\u0441\u043a\u0440\u0438\u043f\u0442
'
try
:
script_basename
.
encode
(
sys
.
getfilesystemencoding
())
except
UnicodeEncodeError
:
raise
unittest
.
SkipTest
(
"Filesystem doesn't support "
"unicode names"
)
source
=
'print("test output")
\n
'
script_name
=
_make_test_script
(
script_dir
,
script_basename
,
source
)
if
not
__debug__
:
run_args
=
(
'-'
+
'O'
*
sys
.
flags
.
optimize
,
script_name
)
else
:
run_args
=
(
script_name
,)
rc
,
out
,
_
=
assert_python_ok
(
*
run_args
)
self
.
assertEqual
(
0
,
rc
)
expected
=
(
"test output"
+
os
.
linesep
)
.
encode
(
'ascii'
)
self
.
assertEqual
(
expected
,
out
)
# non-ascii filename encodable to cp1252, cp932, latin1 and utf8
filename
=
support
.
TESTFN
+
'
\xa3
.py'
try
:
os
.
fsencode
(
filename
)
except
UnicodeEncodeError
:
self
.
skipTest
(
"Filesystem encoding
%
r cannot encode "
"the filename:
%
a"
%
(
sys
.
getfilesystemencoding
(),
filename
))
source
=
'print(ascii(__file__))
\n
'
script_name
=
_make_test_script
(
os
.
curdir
,
filename
,
source
)
self
.
addCleanup
(
support
.
unlink
,
script_name
)
rc
,
stdout
,
stderr
=
assert_python_ok
(
script_name
)
self
.
assertEqual
(
ascii
(
script_name
),
stdout
.
rstrip
()
.
decode
(
'ascii'
),
'stdout=
%
r stderr=
%
r'
%
(
stdout
,
stderr
))
self
.
assertEqual
(
0
,
rc
)
def
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