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
672c5816
Kaydet (Commit)
672c5816
authored
May 13, 2011
tarafından
Vinay Sajip
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added diagnostics to test_logging, after reverting last change.
üst
93ea851e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
test_logging.py
Lib/test/test_logging.py
+12
-9
No files found.
Lib/test/test_logging.py
Dosyayı görüntüle @
672c5816
...
...
@@ -3502,7 +3502,6 @@ class TimedRotatingFileHandlerTest(BaseFileTest):
fh
=
logging
.
handlers
.
TimedRotatingFileHandler
(
self
.
fn
,
'S'
,
backupCount
=
1
)
r
=
logging
.
makeLogRecord
({
'msg'
:
'testing'
})
start
=
datetime
.
datetime
.
now
()
fh
.
emit
(
r
)
self
.
assertLogFile
(
self
.
fn
)
time
.
sleep
(
1.0
)
...
...
@@ -3511,21 +3510,25 @@ class TimedRotatingFileHandlerTest(BaseFileTest):
# At this point, we should have a recent rotated file which we
# can test for the existence of. However, in practice, on some
# machines which run really slowly, we don't know how far back
# in time to go to look for the log file. So, we go back as far as
# when the test started, and stop as soon as we see a rotated file.
# in time to go to look for the log file. So, we go back a fair
# bit, and stop as soon as we see a rotated file. In theory this
# could of course still fail, but the chances are lower.
found
=
False
now
=
datetime
.
datetime
.
now
()
secs
=
1
prev
=
now
-
datetime
.
timedelta
(
seconds
=
secs
)
while
prev
>
start
:
GO_BACK
=
2
*
60
# seconds
for
secs
in
range
(
GO_BACK
):
prev
=
now
-
datetime
.
timedelta
(
seconds
=
secs
)
fn
=
self
.
fn
+
prev
.
strftime
(
".
%
Y-
%
m-
%
d_
%
H-
%
M-
%
S"
)
found
=
os
.
path
.
exists
(
fn
)
if
found
:
self
.
rmfiles
.
append
(
fn
)
break
secs
+=
1
prev
-=
datetime
.
timedelta
(
seconds
=
1
)
msg
=
'No rotated files found, went back
%
d seconds'
%
secs
msg
=
'No rotated files found, went back
%
d seconds'
%
GO_BACK
if
not
found
:
#print additional diagnostics
dn
=
os
.
path
.
dirname
(
self
.
fn
)
files
=
[
f
for
f
in
os
.
listdir
(
dn
)
if
f
.
startswith
(
self
.
fn
)]
print
(
'The only matching files are:
%
s'
%
files
)
self
.
assertTrue
(
found
,
msg
=
msg
)
def
test_invalid
(
self
):
...
...
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