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
3a38a6db
Kaydet (Commit)
3a38a6db
authored
Haz 10, 2011
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
test_platform: ignore DeprecationWarning on popen() test
üst
46591664
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
15 deletions
+20
-15
test_platform.py
Lib/test/test_platform.py
+20
-15
No files found.
Lib/test/test_platform.py
Dosyayı görüntüle @
3a38a6db
import
sys
import
os
import
os
import
unittest
import
platform
import
platform
import
subprocess
import
subprocess
import
sys
import
unittest
import
warnings
from
test
import
support
from
test
import
support
...
@@ -250,10 +251,12 @@ class PlatformTest(unittest.TestCase):
...
@@ -250,10 +251,12 @@ class PlatformTest(unittest.TestCase):
command
=
'"{}" -c "print(
\'
Hello
\'
)"'
.
format
(
sys
.
executable
)
command
=
'"{}" -c "print(
\'
Hello
\'
)"'
.
format
(
sys
.
executable
)
else
:
else
:
command
=
"'{}' -c 'print(
\"
Hello
\"
)'"
.
format
(
sys
.
executable
)
command
=
"'{}' -c 'print(
\"
Hello
\"
)'"
.
format
(
sys
.
executable
)
with
platform
.
popen
(
command
)
as
stdout
:
with
warnings
.
catch_warnings
():
hello
=
stdout
.
read
()
.
strip
()
warnings
.
simplefilter
(
"ignore"
,
DeprecationWarning
)
stdout
.
close
()
with
platform
.
popen
(
command
)
as
stdout
:
self
.
assertEqual
(
hello
,
"Hello"
)
hello
=
stdout
.
read
()
.
strip
()
stdout
.
close
()
self
.
assertEqual
(
hello
,
"Hello"
)
data
=
'plop'
data
=
'plop'
if
mswindows
:
if
mswindows
:
...
@@ -261,15 +264,17 @@ class PlatformTest(unittest.TestCase):
...
@@ -261,15 +264,17 @@ class PlatformTest(unittest.TestCase):
else
:
else
:
command
=
"'{}' -c 'import sys; data=sys.stdin.read(); exit(len(data))'"
command
=
"'{}' -c 'import sys; data=sys.stdin.read(); exit(len(data))'"
command
=
command
.
format
(
sys
.
executable
)
command
=
command
.
format
(
sys
.
executable
)
with
platform
.
popen
(
command
,
'w'
)
as
stdin
:
with
warnings
.
catch_warnings
():
stdout
=
stdin
.
write
(
data
)
warnings
.
simplefilter
(
"ignore"
,
DeprecationWarning
)
ret
=
stdin
.
close
()
with
platform
.
popen
(
command
,
'w'
)
as
stdin
:
self
.
assertIsNotNone
(
ret
)
stdout
=
stdin
.
write
(
data
)
if
os
.
name
==
'nt'
:
ret
=
stdin
.
close
()
returncode
=
ret
self
.
assertIsNotNone
(
ret
)
else
:
if
os
.
name
==
'nt'
:
returncode
=
ret
>>
8
returncode
=
ret
self
.
assertEqual
(
returncode
,
len
(
data
))
else
:
returncode
=
ret
>>
8
self
.
assertEqual
(
returncode
,
len
(
data
))
def
test_main
():
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