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
00086bb7
Kaydet (Commit)
00086bb7
authored
Nis 25, 2012
tarafından
Vinay Sajip
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed test to work on Windows.
üst
5820cc0f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
+18
-18
test_logging.py
Lib/test/test_logging.py
+18
-18
No files found.
Lib/test/test_logging.py
Dosyayı görüntüle @
00086bb7
...
...
@@ -1888,28 +1888,28 @@ class HandlerTest(BaseTest):
pass
time
.
sleep
(
0.004
*
random
.
randint
(
0
,
4
))
def
cleanup
(
remover
,
fn
,
handler
):
handler
.
close
()
remover
.
join
()
if
os
.
path
.
exists
(
fn
):
os
.
unlink
(
fn
)
fd
,
fn
=
tempfile
.
mkstemp
(
'.log'
,
'test_logging-3-'
)
os
.
close
(
fd
)
del_count
=
1000
log_count
=
1000
remover
=
threading
.
Thread
(
target
=
remove_loop
,
args
=
(
fn
,
del_count
))
remover
.
daemon
=
True
remover
.
start
()
del_count
=
500
log_count
=
500
for
delay
in
(
False
,
True
):
fd
,
fn
=
tempfile
.
mkstemp
(
'.log'
,
'test_logging-3-'
)
os
.
close
(
fd
)
remover
=
threading
.
Thread
(
target
=
remove_loop
,
args
=
(
fn
,
del_count
))
remover
.
daemon
=
True
remover
.
start
()
h
=
logging
.
handlers
.
WatchedFileHandler
(
fn
,
delay
=
delay
)
self
.
addCleanup
(
cleanup
,
remover
,
fn
,
h
)
f
=
logging
.
Formatter
(
'
%(asctime)
s:
%(levelname)
s:
%(message)
s'
)
h
.
setFormatter
(
f
)
for
_
in
range
(
log_count
):
time
.
sleep
(
0.005
)
r
=
logging
.
makeLogRecord
({
'msg'
:
'testing'
})
h
.
handle
(
r
)
try
:
for
_
in
range
(
log_count
):
time
.
sleep
(
0.005
)
r
=
logging
.
makeLogRecord
({
'msg'
:
'testing'
})
h
.
handle
(
r
)
finally
:
h
.
close
()
remover
.
join
()
if
os
.
path
.
exists
(
fn
):
os
.
unlink
(
fn
)
# Set the locale to the platform-dependent default. I have no idea
...
...
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