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
09227b91
Kaydet (Commit)
09227b91
authored
Nis 27, 2010
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #7449, part 8: don't skip the whole test_asynchat if threading is missing
TestFifo can be executed without the threading module
üst
be595d33
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
test_asynchat.py
Lib/test/test_asynchat.py
+10
-7
No files found.
Lib/test/test_asynchat.py
Dosyayı görüntüle @
09227b91
# test asynchat
import
asyncore
,
asynchat
,
socket
,
t
hreading
,
t
ime
import
asyncore
,
asynchat
,
socket
,
time
import
unittest
import
sys
from
test
import
test_support
# Skip tests if thread module does not exist.
test_support
.
import_module
(
'thread'
)
try
:
import
threading
except
ImportError
:
threading
=
None
HOST
=
test_support
.
HOST
SERVER_QUIT
=
'QUIT
\n
'
class
echo_server
(
threading
.
Thread
):
if
threading
:
class
echo_server
(
threading
.
Thread
):
# parameter to determine the number of bytes passed back to the
# client each send
chunk_size
=
1
...
...
@@ -57,7 +59,7 @@ class echo_server(threading.Thread):
conn
.
close
()
self
.
sock
.
close
()
class
echo_client
(
asynchat
.
async_chat
):
class
echo_client
(
asynchat
.
async_chat
):
def
__init__
(
self
,
terminator
,
server_port
):
asynchat
.
async_chat
.
__init__
(
self
)
...
...
@@ -84,7 +86,7 @@ class echo_client(asynchat.async_chat):
self
.
buffer
=
""
def
start_echo_server
():
def
start_echo_server
():
event
=
threading
.
Event
()
s
=
echo_server
(
event
)
s
.
start
()
...
...
@@ -94,6 +96,7 @@ def start_echo_server():
return
s
,
event
@unittest.skipUnless
(
threading
,
'Threading required for this test.'
)
class
TestAsynchat
(
unittest
.
TestCase
):
usepoll
=
False
...
...
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