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
3cd863c8
Kaydet (Commit)
3cd863c8
authored
Ara 17, 2015
tarafından
Yury Selivanov
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
asyncio/tests: Fix ResourceWarnings related to unclosed transports
üst
5f68ca66
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
18 deletions
+29
-18
test_base_events.py
Lib/test/test_asyncio/test_base_events.py
+29
-18
No files found.
Lib/test/test_asyncio/test_base_events.py
Dosyayı görüntüle @
3cd863c8
...
...
@@ -1157,21 +1157,28 @@ class BaseEventLoopWithSelectorTests(test_utils.TestCase):
self
.
loop
.
add_writer
=
mock
.
Mock
()
self
.
loop
.
add_writer
.
_is_coroutine
=
False
coro
=
self
.
loop
.
create_connection
(
MyProto
,
'1.2.3.4'
,
80
)
self
.
loop
.
run_until_complete
(
coro
)
sock
.
connect
.
assert_called_with
((
'1.2.3.4'
,
80
))
m_socket
.
socket
.
assert_called_with
(
family
=
m_socket
.
AF_INET
,
proto
=
m_socket
.
IPPROTO_TCP
,
type
=
m_socket
.
SOCK_STREAM
)
coro
=
self
.
loop
.
create_connection
(
asyncio
.
Protocol
,
'1.2.3.4'
,
80
)
t
,
p
=
self
.
loop
.
run_until_complete
(
coro
)
try
:
sock
.
connect
.
assert_called_with
((
'1.2.3.4'
,
80
))
m_socket
.
socket
.
assert_called_with
(
family
=
m_socket
.
AF_INET
,
proto
=
m_socket
.
IPPROTO_TCP
,
type
=
m_socket
.
SOCK_STREAM
)
finally
:
t
.
close
()
test_utils
.
run_briefly
(
self
.
loop
)
# allow transport to close
sock
.
family
=
socket
.
AF_INET6
coro
=
self
.
loop
.
create_connection
(
MyProto
,
'::2'
,
80
)
self
.
loop
.
run_until_complete
(
coro
)
sock
.
connect
.
assert_called_with
((
'::2'
,
80
))
m_socket
.
socket
.
assert_called_with
(
family
=
m_socket
.
AF_INET6
,
proto
=
m_socket
.
IPPROTO_TCP
,
type
=
m_socket
.
SOCK_STREAM
)
coro
=
self
.
loop
.
create_connection
(
asyncio
.
Protocol
,
'::2'
,
80
)
t
,
p
=
self
.
loop
.
run_until_complete
(
coro
)
try
:
sock
.
connect
.
assert_called_with
((
'::2'
,
80
))
m_socket
.
socket
.
assert_called_with
(
family
=
m_socket
.
AF_INET6
,
proto
=
m_socket
.
IPPROTO_TCP
,
type
=
m_socket
.
SOCK_STREAM
)
finally
:
t
.
close
()
test_utils
.
run_briefly
(
self
.
loop
)
# allow transport to close
@patch_socket
def
test_create_connection_ip_addr
(
self
,
m_socket
):
...
...
@@ -1559,11 +1566,15 @@ class BaseEventLoopWithSelectorTests(test_utils.TestCase):
reuse_address
=
False
,
reuse_port
=
reuseport_supported
)
self
.
loop
.
run_until_complete
(
coro
)
bind
.
assert_called_with
((
'1.2.3.4'
,
0
))
m_socket
.
socket
.
assert_called_with
(
family
=
m_socket
.
AF_INET
,
proto
=
m_socket
.
IPPROTO_UDP
,
type
=
m_socket
.
SOCK_DGRAM
)
t
,
p
=
self
.
loop
.
run_until_complete
(
coro
)
try
:
bind
.
assert_called_with
((
'1.2.3.4'
,
0
))
m_socket
.
socket
.
assert_called_with
(
family
=
m_socket
.
AF_INET
,
proto
=
m_socket
.
IPPROTO_UDP
,
type
=
m_socket
.
SOCK_DGRAM
)
finally
:
t
.
close
()
test_utils
.
run_briefly
(
self
.
loop
)
# allow transport to close
def
test_accept_connection_retry
(
self
):
sock
=
mock
.
Mock
()
...
...
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