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
cc221b24
Kaydet (Commit)
cc221b24
authored
Eki 31, 2010
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
close some more files
üst
5dc8fabb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
test_subprocess.py
Lib/test/test_subprocess.py
+7
-0
No files found.
Lib/test/test_subprocess.py
Dosyayı görüntüle @
cc221b24
...
@@ -173,6 +173,7 @@ class ProcessTestCase(BaseTestCase):
...
@@ -173,6 +173,7 @@ class ProcessTestCase(BaseTestCase):
def
test_stdin_filedes
(
self
):
def
test_stdin_filedes
(
self
):
# stdin is set to open file descriptor
# stdin is set to open file descriptor
tf
=
tempfile
.
TemporaryFile
()
tf
=
tempfile
.
TemporaryFile
()
self
.
addCleanup
(
tf
.
close
)
d
=
tf
.
fileno
()
d
=
tf
.
fileno
()
os
.
write
(
d
,
b
"pear"
)
os
.
write
(
d
,
b
"pear"
)
os
.
lseek
(
d
,
0
,
0
)
os
.
lseek
(
d
,
0
,
0
)
...
@@ -185,6 +186,7 @@ class ProcessTestCase(BaseTestCase):
...
@@ -185,6 +186,7 @@ class ProcessTestCase(BaseTestCase):
def
test_stdin_fileobj
(
self
):
def
test_stdin_fileobj
(
self
):
# stdin is set to open file object
# stdin is set to open file object
tf
=
tempfile
.
TemporaryFile
()
tf
=
tempfile
.
TemporaryFile
()
self
.
addCleanup
(
tf
.
close
)
tf
.
write
(
b
"pear"
)
tf
.
write
(
b
"pear"
)
tf
.
seek
(
0
)
tf
.
seek
(
0
)
p
=
subprocess
.
Popen
([
sys
.
executable
,
"-c"
,
p
=
subprocess
.
Popen
([
sys
.
executable
,
"-c"
,
...
@@ -203,6 +205,7 @@ class ProcessTestCase(BaseTestCase):
...
@@ -203,6 +205,7 @@ class ProcessTestCase(BaseTestCase):
def
test_stdout_filedes
(
self
):
def
test_stdout_filedes
(
self
):
# stdout is set to open file descriptor
# stdout is set to open file descriptor
tf
=
tempfile
.
TemporaryFile
()
tf
=
tempfile
.
TemporaryFile
()
self
.
addCleanup
(
tf
.
close
)
d
=
tf
.
fileno
()
d
=
tf
.
fileno
()
p
=
subprocess
.
Popen
([
sys
.
executable
,
"-c"
,
p
=
subprocess
.
Popen
([
sys
.
executable
,
"-c"
,
'import sys; sys.stdout.write("orange")'
],
'import sys; sys.stdout.write("orange")'
],
...
@@ -214,6 +217,7 @@ class ProcessTestCase(BaseTestCase):
...
@@ -214,6 +217,7 @@ class ProcessTestCase(BaseTestCase):
def
test_stdout_fileobj
(
self
):
def
test_stdout_fileobj
(
self
):
# stdout is set to open file object
# stdout is set to open file object
tf
=
tempfile
.
TemporaryFile
()
tf
=
tempfile
.
TemporaryFile
()
self
.
addCleanup
(
tf
.
close
)
p
=
subprocess
.
Popen
([
sys
.
executable
,
"-c"
,
p
=
subprocess
.
Popen
([
sys
.
executable
,
"-c"
,
'import sys; sys.stdout.write("orange")'
],
'import sys; sys.stdout.write("orange")'
],
stdout
=
tf
)
stdout
=
tf
)
...
@@ -231,6 +235,7 @@ class ProcessTestCase(BaseTestCase):
...
@@ -231,6 +235,7 @@ class ProcessTestCase(BaseTestCase):
def
test_stderr_filedes
(
self
):
def
test_stderr_filedes
(
self
):
# stderr is set to open file descriptor
# stderr is set to open file descriptor
tf
=
tempfile
.
TemporaryFile
()
tf
=
tempfile
.
TemporaryFile
()
self
.
addCleanup
(
tf
.
close
)
d
=
tf
.
fileno
()
d
=
tf
.
fileno
()
p
=
subprocess
.
Popen
([
sys
.
executable
,
"-c"
,
p
=
subprocess
.
Popen
([
sys
.
executable
,
"-c"
,
'import sys; sys.stderr.write("strawberry")'
],
'import sys; sys.stderr.write("strawberry")'
],
...
@@ -242,6 +247,7 @@ class ProcessTestCase(BaseTestCase):
...
@@ -242,6 +247,7 @@ class ProcessTestCase(BaseTestCase):
def
test_stderr_fileobj
(
self
):
def
test_stderr_fileobj
(
self
):
# stderr is set to open file object
# stderr is set to open file object
tf
=
tempfile
.
TemporaryFile
()
tf
=
tempfile
.
TemporaryFile
()
self
.
addCleanup
(
tf
.
close
)
p
=
subprocess
.
Popen
([
sys
.
executable
,
"-c"
,
p
=
subprocess
.
Popen
([
sys
.
executable
,
"-c"
,
'import sys; sys.stderr.write("strawberry")'
],
'import sys; sys.stderr.write("strawberry")'
],
stderr
=
tf
)
stderr
=
tf
)
...
@@ -263,6 +269,7 @@ class ProcessTestCase(BaseTestCase):
...
@@ -263,6 +269,7 @@ class ProcessTestCase(BaseTestCase):
def
test_stdout_stderr_file
(
self
):
def
test_stdout_stderr_file
(
self
):
# capture stdout and stderr to the same open file
# capture stdout and stderr to the same open file
tf
=
tempfile
.
TemporaryFile
()
tf
=
tempfile
.
TemporaryFile
()
self
.
addCleanup
(
tf
.
close
)
p
=
subprocess
.
Popen
([
sys
.
executable
,
"-c"
,
p
=
subprocess
.
Popen
([
sys
.
executable
,
"-c"
,
'import sys;'
'import sys;'
'sys.stdout.write("apple");'
'sys.stdout.write("apple");'
...
...
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