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
f829d1f5
Kaydet (Commit)
f829d1f5
authored
Eki 27, 2009
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Suppress transient refleaks in test_asyncore
üst
abc9f703
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
25 deletions
+29
-25
test_asyncore.py
Lib/test/test_asyncore.py
+29
-25
No files found.
Lib/test/test_asyncore.py
Dosyayı görüntüle @
f829d1f5
...
@@ -319,40 +319,44 @@ class DispatcherWithSendTests(unittest.TestCase):
...
@@ -319,40 +319,44 @@ class DispatcherWithSendTests(unittest.TestCase):
def
tearDown
(
self
):
def
tearDown
(
self
):
asyncore
.
close_all
()
asyncore
.
close_all
()
@test_support.reap_threads
def
test_send
(
self
):
def
test_send
(
self
):
self
.
evt
=
threading
.
Event
()
evt
=
threading
.
Event
()
s
elf
.
s
ock
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
sock
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
s
elf
.
s
ock
.
settimeout
(
3
)
sock
.
settimeout
(
3
)
self
.
port
=
test_support
.
bind_port
(
self
.
sock
)
port
=
test_support
.
bind_port
(
sock
)
cap
=
StringIO
()
cap
=
StringIO
()
args
=
(
self
.
evt
,
cap
,
self
.
sock
)
args
=
(
evt
,
cap
,
sock
)
threading
.
Thread
(
target
=
capture_server
,
args
=
args
)
.
start
()
t
=
threading
.
Thread
(
target
=
capture_server
,
args
=
args
)
t
.
start
()
# wait a little longer for the server to initialize (it sometimes
try
:
# refuses connections on slow machines without this wait)
# wait a little longer for the server to initialize (it sometimes
time
.
sleep
(
0.2
)
# refuses connections on slow machines without this wait)
time
.
sleep
(
0.2
)
data
=
"Suppose there isn't a 16-ton weight?"
data
=
"Suppose there isn't a 16-ton weight?"
d
=
dispatcherwithsend_noread
()
d
=
dispatcherwithsend_noread
()
d
.
create_socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
d
.
create_socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
d
.
connect
((
HOST
,
self
.
port
))
d
.
connect
((
HOST
,
port
))
# give time for socket to connect
# give time for socket to connect
time
.
sleep
(
0.1
)
time
.
sleep
(
0.1
)
d
.
send
(
data
)
d
.
send
(
data
)
d
.
send
(
data
)
d
.
send
(
data
)
d
.
send
(
'
\n
'
)
d
.
send
(
'
\n
'
)
n
=
1000
n
=
1000
while
d
.
out_buffer
and
n
>
0
:
while
d
.
out_buffer
and
n
>
0
:
asyncore
.
poll
()
asyncore
.
poll
()
n
-=
1
n
-=
1
self
.
evt
.
wait
()
evt
.
wait
()
self
.
assertEqual
(
cap
.
getvalue
(),
data
*
2
)
self
.
assertEqual
(
cap
.
getvalue
(),
data
*
2
)
finally
:
t
.
join
()
class
DispatcherWithSendTests_UsePoll
(
DispatcherWithSendTests
):
class
DispatcherWithSendTests_UsePoll
(
DispatcherWithSendTests
):
...
...
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