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
4d825b45
Kaydet (Commit)
4d825b45
authored
Ara 19, 2014
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
asyncio: IocpProactor.wait_for_handle() test now also checks the result of the
future
üst
1b9763d0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
windows_events.py
Lib/asyncio/windows_events.py
+5
-0
test_windows_events.py
Lib/test/test_asyncio/test_windows_events.py
+6
-2
No files found.
Lib/asyncio/windows_events.py
Dosyayı görüntüle @
4d825b45
...
@@ -427,6 +427,11 @@ class IocpProactor:
...
@@ -427,6 +427,11 @@ class IocpProactor:
return
self
.
_register
(
ov
,
None
,
finish_connect_pipe
,
wait_for_post
=
True
)
return
self
.
_register
(
ov
,
None
,
finish_connect_pipe
,
wait_for_post
=
True
)
def
wait_for_handle
(
self
,
handle
,
timeout
=
None
):
def
wait_for_handle
(
self
,
handle
,
timeout
=
None
):
"""Wait for a handle.
Return a Future object. The result of the future is True if the wait
completed, or False if the wait did not complete (on timeout).
"""
if
timeout
is
None
:
if
timeout
is
None
:
ms
=
_winapi
.
INFINITE
ms
=
_winapi
.
INFINITE
else
:
else
:
...
...
Lib/test/test_asyncio/test_windows_events.py
Dosyayı görüntüle @
4d825b45
...
@@ -98,8 +98,10 @@ class ProactorTests(test_utils.TestCase):
...
@@ -98,8 +98,10 @@ class ProactorTests(test_utils.TestCase):
# result should be False at timeout
# result should be False at timeout
fut
=
self
.
loop
.
_proactor
.
wait_for_handle
(
event
,
0.5
)
fut
=
self
.
loop
.
_proactor
.
wait_for_handle
(
event
,
0.5
)
start
=
self
.
loop
.
time
()
start
=
self
.
loop
.
time
()
self
.
loop
.
run_until_complete
(
fut
)
done
=
self
.
loop
.
run_until_complete
(
fut
)
elapsed
=
self
.
loop
.
time
()
-
start
elapsed
=
self
.
loop
.
time
()
-
start
self
.
assertEqual
(
done
,
False
)
self
.
assertFalse
(
fut
.
result
())
self
.
assertFalse
(
fut
.
result
())
self
.
assertTrue
(
0.48
<
elapsed
<
0.9
,
elapsed
)
self
.
assertTrue
(
0.48
<
elapsed
<
0.9
,
elapsed
)
...
@@ -109,8 +111,10 @@ class ProactorTests(test_utils.TestCase):
...
@@ -109,8 +111,10 @@ class ProactorTests(test_utils.TestCase):
# result should be True immediately
# result should be True immediately
fut
=
self
.
loop
.
_proactor
.
wait_for_handle
(
event
,
10
)
fut
=
self
.
loop
.
_proactor
.
wait_for_handle
(
event
,
10
)
start
=
self
.
loop
.
time
()
start
=
self
.
loop
.
time
()
self
.
loop
.
run_until_complete
(
fut
)
done
=
self
.
loop
.
run_until_complete
(
fut
)
elapsed
=
self
.
loop
.
time
()
-
start
elapsed
=
self
.
loop
.
time
()
-
start
self
.
assertEqual
(
done
,
True
)
self
.
assertTrue
(
fut
.
result
())
self
.
assertTrue
(
fut
.
result
())
self
.
assertTrue
(
0
<=
elapsed
<
0.3
,
elapsed
)
self
.
assertTrue
(
0
<=
elapsed
<
0.3
,
elapsed
)
...
...
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