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
87f16f89
Kaydet (Commit)
87f16f89
authored
Haz 25, 2014
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #21163, asyncio: Fix some "Task was destroyed but it is pending!" logs in tests
üst
36820b6e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
16 deletions
+22
-16
test_locks.py
Lib/test/test_asyncio/test_locks.py
+1
-0
test_queues.py
Lib/test/test_asyncio/test_queues.py
+17
-10
test_tasks.py
Lib/test/test_asyncio/test_tasks.py
+4
-6
No files found.
Lib/test/test_asyncio/test_locks.py
Dosyayı görüntüle @
87f16f89
...
...
@@ -783,6 +783,7 @@ class SemaphoreTests(test_utils.TestCase):
# cleanup locked semaphore
sem
.
release
()
self
.
loop
.
run_until_complete
(
t4
)
def
test_acquire_cancel
(
self
):
sem
=
asyncio
.
Semaphore
(
loop
=
self
.
loop
)
...
...
Lib/test/test_asyncio/test_queues.py
Dosyayı görüntüle @
87f16f89
...
...
@@ -362,16 +362,21 @@ class QueuePutTests(_QueueTestBase):
def
test_put_cancelled_race
(
self
):
q
=
asyncio
.
Queue
(
loop
=
self
.
loop
,
maxsize
=
1
)
asyncio
.
Task
(
q
.
put
(
'a'
),
loop
=
self
.
loop
)
asyncio
.
Task
(
q
.
put
(
'c
'
),
loop
=
self
.
loop
)
t
=
asyncio
.
Task
(
q
.
put
(
'b
'
),
loop
=
self
.
loop
)
put_a
=
asyncio
.
Task
(
q
.
put
(
'a'
),
loop
=
self
.
loop
)
put_b
=
asyncio
.
Task
(
q
.
put
(
'b
'
),
loop
=
self
.
loop
)
put_c
=
asyncio
.
Task
(
q
.
put
(
'X
'
),
loop
=
self
.
loop
)
test_utils
.
run_briefly
(
self
.
loop
)
t
.
cancel
()
self
.
assertTrue
(
put_a
.
done
())
self
.
assertFalse
(
put_b
.
done
())
put_c
.
cancel
()
test_utils
.
run_briefly
(
self
.
loop
)
self
.
assertTrue
(
t
.
done
())
self
.
assertTrue
(
put_c
.
done
())
self
.
assertEqual
(
q
.
get_nowait
(),
'a'
)
self
.
assertEqual
(
q
.
get_nowait
(),
'c'
)
self
.
assertEqual
(
q
.
get_nowait
(),
'b'
)
self
.
loop
.
run_until_complete
(
put_b
)
def
test_put_with_waiting_getters
(
self
):
q
=
asyncio
.
Queue
(
loop
=
self
.
loop
)
...
...
@@ -431,18 +436,20 @@ class JoinableQueueTests(_QueueTestBase):
@asyncio.coroutine
def
test
():
for
_
in
range
(
2
):
asyncio
.
Task
(
worker
(),
loop
=
self
.
loop
)
tasks
=
[
asyncio
.
Task
(
worker
(),
loop
=
self
.
loop
)
for
index
in
range
(
2
)]
yield
from
q
.
join
()
return
tasks
self
.
loop
.
run_until_complete
(
test
())
tasks
=
self
.
loop
.
run_until_complete
(
test
())
self
.
assertEqual
(
sum
(
range
(
100
)),
accumulator
)
# close running generators
running
=
False
for
i
in
range
(
2
):
for
i
in
range
(
len
(
tasks
)
):
q
.
put_nowait
(
0
)
self
.
loop
.
run_until_complete
(
asyncio
.
wait
(
tasks
,
loop
=
self
.
loop
))
def
test_join_empty_queue
(
self
):
q
=
asyncio
.
JoinableQueue
(
loop
=
self
.
loop
)
...
...
Lib/test/test_asyncio/test_tasks.py
Dosyayı görüntüle @
87f16f89
...
...
@@ -1763,16 +1763,14 @@ class CoroutineGatherTests(GatherTestsBase, test_utils.TestCase):
gen2
=
coro
()
fut
=
asyncio
.
gather
(
gen1
,
gen2
)
self
.
assertIs
(
fut
.
_loop
,
self
.
one_loop
)
gen1
.
close
()
gen2
.
close
()
self
.
one_loop
.
run_until_complete
(
fut
)
self
.
set_event_loop
(
self
.
other_loop
,
cleanup
=
False
)
gen3
=
coro
()
gen4
=
coro
()
fut
=
asyncio
.
gather
(
gen3
,
gen4
,
loop
=
self
.
other_loop
)
self
.
assertIs
(
fut
.
_loop
,
self
.
other_loop
)
gen3
.
close
()
gen4
.
close
()
fut2
=
asyncio
.
gather
(
gen3
,
gen4
,
loop
=
self
.
other_loop
)
self
.
assertIs
(
fut2
.
_loop
,
self
.
other_loop
)
self
.
other_loop
.
run_until_complete
(
fut2
)
def
test_duplicate_coroutines
(
self
):
@asyncio.coroutine
...
...
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