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
ae553eb7
Kaydet (Commit)
ae553eb7
authored
Kas 28, 2014
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge 3.4 (asyncio)
üst
79d784ab
cbbd04d1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
test_subprocess.py
Lib/test/test_asyncio/test_subprocess.py
+10
-7
No files found.
Lib/test/test_asyncio/test_subprocess.py
Dosyayı görüntüle @
ae553eb7
...
...
@@ -163,13 +163,14 @@ class SubprocessMixin:
self
.
loop
.
run_until_complete
(
proc
.
wait
())
def
test_pause_reading
(
self
):
limit
=
10
size
=
(
limit
*
2
+
1
)
@asyncio.coroutine
def
test_pause_reading
():
limit
=
100
code
=
'
\n
'
.
join
((
'import sys'
,
'sys.stdout.write("x" *
%
s)'
%
(
limit
*
2
+
1
)
,
'sys.stdout.write("x" *
%
s)'
%
size
,
'sys.stdout.flush()'
,
))
proc
=
yield
from
asyncio
.
create_subprocess_exec
(
...
...
@@ -181,17 +182,19 @@ class SubprocessMixin:
stdout_transport
=
proc
.
_transport
.
get_pipe_transport
(
1
)
stdout_transport
.
pause_reading
=
mock
.
Mock
()
yield
from
proc
.
wait
()
stdout
,
stderr
=
yield
from
proc
.
communicate
()
# The child process produced more than limit bytes of output,
# the stream reader transport should pause the protocol to not
# allocate too much memory.
return
stdout_transport
.
pause_reading
.
called
return
(
stdout
,
stdout_transport
)
# Issue #22685: Ensure that the stream reader pauses the protocol
# when the child process produces too much data
called
=
self
.
loop
.
run_until_complete
(
test_pause_reading
())
self
.
assertTrue
(
called
)
stdout
,
transport
=
self
.
loop
.
run_until_complete
(
test_pause_reading
())
self
.
assertEqual
(
stdout
,
b
'x'
*
size
)
self
.
assertTrue
(
transport
.
pause_reading
.
called
)
if
sys
.
platform
!=
'win32'
:
...
...
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