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
e6a53797
Kaydet (Commit)
e6a53797
authored
Mar 06, 2014
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
asyncio, Tulip issue 157: Improve test_events.py, avoid run_briefly() which is
not reliable
üst
eeeebcd8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
9 deletions
+6
-9
test_utils.py
Lib/asyncio/test_utils.py
+6
-9
test_events.py
Lib/test/test_asyncio/test_events.py
+0
-0
No files found.
Lib/asyncio/test_utils.py
Dosyayı görüntüle @
e6a53797
...
...
@@ -21,10 +21,11 @@ try:
except
ImportError
:
# pragma: no cover
ssl
=
None
from
.
import
tasks
from
.
import
base_events
from
.
import
events
from
.
import
futures
from
.
import
selectors
from
.
import
tasks
if
sys
.
platform
==
'win32'
:
# pragma: no cover
...
...
@@ -52,18 +53,14 @@ def run_briefly(loop):
gen
.
close
()
def
run_until
(
loop
,
pred
,
timeout
=
None
):
if
timeout
is
not
None
:
deadline
=
time
.
time
()
+
timeout
def
run_until
(
loop
,
pred
,
timeout
=
30
):
deadline
=
time
.
time
()
+
timeout
while
not
pred
():
if
timeout
is
not
None
:
timeout
=
deadline
-
time
.
time
()
if
timeout
<=
0
:
return
False
loop
.
run_until_complete
(
tasks
.
sleep
(
timeout
,
loop
=
loop
))
else
:
run_briefly
(
loop
)
return
True
raise
futures
.
TimeoutError
()
loop
.
run_until_complete
(
tasks
.
sleep
(
0.001
,
loop
=
loop
))
def
run_once
(
loop
):
...
...
Lib/test/test_asyncio/test_events.py
Dosyayı görüntüle @
e6a53797
This diff is collapsed.
Click to expand it.
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