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
3dd734fe
Kaydet (Commit)
3dd734fe
authored
Şub 05, 2010
tarafından
Vinay Sajip
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #7857: test_logging: listener test now uses find_unused_port().
üst
565d7858
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
18 deletions
+20
-18
test_logging.py
Lib/test/test_logging.py
+20
-18
No files found.
Lib/test/test_logging.py
Dosyayı görüntüle @
3dd734fe
...
@@ -40,7 +40,8 @@ import string
...
@@ -40,7 +40,8 @@ import string
import
struct
import
struct
import
sys
import
sys
import
tempfile
import
tempfile
from
test.test_support
import
captured_stdout
,
run_with_locale
,
run_unittest
from
test.test_support
import
captured_stdout
,
run_with_locale
,
run_unittest
,
\
find_unused_port
import
textwrap
import
textwrap
import
threading
import
threading
import
time
import
time
...
@@ -1573,24 +1574,25 @@ class ConfigDictTest(BaseTest):
...
@@ -1573,24 +1574,25 @@ class ConfigDictTest(BaseTest):
self
.
test_config1_ok
(
self
.
config11
)
self
.
test_config1_ok
(
self
.
config11
)
def
setup_via_listener
(
self
,
text
):
def
setup_via_listener
(
self
,
text
):
PORT
=
9030
port
=
find_unused_port
()
t
=
logging
.
config
.
listen
(
PORT
)
t
=
logging
.
config
.
listen
(
port
)
t
.
start
()
t
.
start
()
try
:
sock
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
sock
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
sock
.
connect
((
'localhost'
,
PORT
))
sock
.
connect
((
'localhost'
,
port
))
slen
=
struct
.
pack
(
'>L'
,
len
(
text
))
slen
=
struct
.
pack
(
'>L'
,
len
(
text
))
s
=
slen
+
text
s
=
slen
+
text
sentsofar
=
0
sentsofar
=
0
left
=
len
(
s
)
left
=
len
(
s
)
while
left
>
0
:
while
left
>
0
:
sent
=
sock
.
send
(
s
[
sentsofar
:])
sent
=
sock
.
send
(
s
[
sentsofar
:])
sentsofar
+=
sent
sentsofar
+=
sent
left
-=
sent
left
-=
sent
sock
.
close
()
sock
.
close
()
logging
.
config
.
stopListening
()
finally
:
t
.
join
()
logging
.
config
.
stopListening
()
t
.
join
()
def
test_listen_config_10_ok
(
self
):
def
test_listen_config_10_ok
(
self
):
with
captured_stdout
()
as
output
:
with
captured_stdout
()
as
output
:
...
...
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