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
4652bf2a
Unverified
Kaydet (Commit)
4652bf2a
authored
Kas 10, 2017
tarafından
Yury Selivanov
Kaydeden (comit)
GitHub
Kas 10, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Rewrite asyncio test to be more meaningful (#4363)
üst
9f914a01
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
11 deletions
+16
-11
test_base_events.py
Lib/test/test_asyncio/test_base_events.py
+16
-11
No files found.
Lib/test/test_asyncio/test_base_events.py
Dosyayı görüntüle @
4652bf2a
...
@@ -530,20 +530,25 @@ class BaseEventLoopTests(test_utils.TestCase):
...
@@ -530,20 +530,25 @@ class BaseEventLoopTests(test_utils.TestCase):
other_loop
.
run_until_complete
,
task
)
other_loop
.
run_until_complete
,
task
)
def
test_run_until_complete_loop_orphan_future_close_loop
(
self
):
def
test_run_until_complete_loop_orphan_future_close_loop
(
self
):
async
def
foo
(
sec
=
0
):
class
ShowStopper
(
BaseException
):
await
asyncio
.
sleep
(
sec
)
pass
self
.
loop
.
close
()
async
def
foo
(
delay
):
loop
=
asyncio
.
new_event_loop
()
await
asyncio
.
sleep
(
delay
,
loop
=
self
.
loop
)
asyncio
.
set_event_loop
(
loop
)
def
throw
():
raise
ShowStopper
self
.
loop
.
_process_events
=
mock
.
Mock
()
self
.
loop
.
call_soon
(
throw
)
try
:
try
:
with
mock
.
patch
(
'asyncio.base_events.BaseEventLoop.run_forever'
,
self
.
loop
.
run_until_complete
(
foo
(
0.1
))
side_effect
=
Exception
):
except
ShowStopper
:
loop
.
run_until_complete
(
foo
())
except
:
pass
pass
loop
.
run_until_complete
(
foo
(
0.1
))
loop
.
close
()
# This call fails if run_until_complete does not clean up
# done-callback for the previous future.
self
.
loop
.
run_until_complete
(
foo
(
0.2
))
def
test_subprocess_exec_invalid_args
(
self
):
def
test_subprocess_exec_invalid_args
(
self
):
args
=
[
sys
.
executable
,
'-c'
,
'pass'
]
args
=
[
sys
.
executable
,
'-c'
,
'pass'
]
...
...
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