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
e3540b47
Kaydet (Commit)
e3540b47
authored
Agu 24, 2011
tarafından
Charles-François Natali
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #12656: Fix test_asyncore failures on Windows buildbots.
üst
e78cbeca
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
test_asyncore.py
Lib/test/test_asyncore.py
+7
-5
No files found.
Lib/test/test_asyncore.py
Dosyayı görüntüle @
e3540b47
...
...
@@ -20,6 +20,8 @@ except ImportError:
HOST
=
support
.
HOST
HAS_UNIX_SOCKETS
=
hasattr
(
socket
,
'AF_UNIX'
)
class
dummysocket
:
def
__init__
(
self
):
self
.
closed
=
False
...
...
@@ -89,7 +91,7 @@ def capture_server(evt, buf, serv):
def
bind_af_aware
(
sock
,
addr
):
"""Helper function to bind a socket according to its family."""
if
sock
.
family
==
socket
.
AF_UNIX
:
if
HAS_UNIX_SOCKETS
and
sock
.
family
==
socket
.
AF_UNIX
:
# Make sure the path doesn't exist.
unlink
(
addr
)
sock
.
bind
(
addr
)
...
...
@@ -636,7 +638,7 @@ class BaseTestAPI(unittest.TestCase):
# Make sure handle_expt is called on OOB data received.
# Note: this might fail on some platforms as OOB data is
# tenuously supported and rarely used.
if
self
.
family
==
socket
.
AF_UNIX
:
if
HAS_UNIX_SOCKETS
and
self
.
family
==
socket
.
AF_UNIX
:
self
.
skipTest
(
"Not applicable to AF_UNIX sockets."
)
class
TestClient
(
BaseClient
):
...
...
@@ -708,7 +710,7 @@ class BaseTestAPI(unittest.TestCase):
self
.
assertEqual
(
s
.
socket
.
type
,
socket
.
SOCK_STREAM
|
SOCK_NONBLOCK
)
def
test_bind
(
self
):
if
self
.
family
==
socket
.
AF_UNIX
:
if
HAS_UNIX_SOCKETS
and
self
.
family
==
socket
.
AF_UNIX
:
self
.
skipTest
(
"Not applicable to AF_UNIX sockets."
)
s1
=
asyncore
.
dispatcher
()
s1
.
create_socket
(
self
.
family
)
...
...
@@ -722,7 +724,7 @@ class BaseTestAPI(unittest.TestCase):
self
.
assertRaises
(
socket
.
error
,
s2
.
bind
,
(
self
.
addr
[
0
],
port
))
def
test_set_reuse_addr
(
self
):
if
self
.
family
==
socket
.
AF_UNIX
:
if
HAS_UNIX_SOCKETS
and
self
.
family
==
socket
.
AF_UNIX
:
self
.
skipTest
(
"Not applicable to AF_UNIX sockets."
)
sock
=
socket
.
socket
(
self
.
family
)
try
:
...
...
@@ -753,7 +755,7 @@ class TestAPI_UseIPv6Sockets(BaseTestAPI):
family
=
socket
.
AF_INET6
addr
=
(
'::1'
,
0
)
@unittest.skipUnless
(
hasattr
(
socket
,
'AF_UNIX'
)
,
'Unix sockets required'
)
@unittest.skipUnless
(
HAS_UNIX_SOCKETS
,
'Unix sockets required'
)
class
TestAPI_UseUnixSockets
(
BaseTestAPI
):
family
=
socket
.
AF_UNIX
addr
=
support
.
TESTFN
...
...
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