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
b046b807
Kaydet (Commit)
b046b807
authored
Eki 30, 2010
tarafından
Vinay Sajip
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Remove ResourceWarnings caused by files left open.
üst
cc2adbc6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
test_logging.py
Lib/test/test_logging.py
+7
-2
No files found.
Lib/test/test_logging.py
Dosyayı görüntüle @
b046b807
...
...
@@ -907,7 +907,7 @@ class EncodingTest(BaseTest):
def
test_encoding_plain_file
(
self
):
# In Python 2.x, a plain file object is treated as having no encoding.
log
=
logging
.
getLogger
(
"test"
)
fn
=
tempfile
.
mktemp
(
".log"
)
fn
=
tempfile
.
mktemp
(
".log"
,
"test_logging-1-"
)
# the non-ascii data we write to the log.
data
=
"foo
\x80
"
try
:
...
...
@@ -1932,7 +1932,7 @@ class BaseFileTest(BaseTest):
def
setUp
(
self
):
BaseTest
.
setUp
(
self
)
self
.
fn
=
tempfile
.
mktemp
(
".log"
)
self
.
fn
=
tempfile
.
mktemp
(
".log"
,
"test_logging-2-"
)
self
.
rmfiles
=
[]
def
tearDown
(
self
):
...
...
@@ -1956,10 +1956,12 @@ class RotatingFileHandlerTest(BaseFileTest):
# If maxbytes is zero rollover never occurs
rh
=
logging
.
handlers
.
RotatingFileHandler
(
self
.
fn
,
maxBytes
=
0
)
self
.
assertFalse
(
rh
.
shouldRollover
(
None
))
rh
.
close
()
def
test_should_rollover
(
self
):
rh
=
logging
.
handlers
.
RotatingFileHandler
(
self
.
fn
,
maxBytes
=
1
)
self
.
assertTrue
(
rh
.
shouldRollover
(
self
.
next_rec
()))
rh
.
close
()
def
test_file_created
(
self
):
# checks that the file is created and assumes it was created
...
...
@@ -1968,6 +1970,7 @@ class RotatingFileHandlerTest(BaseFileTest):
rh
=
logging
.
handlers
.
RotatingFileHandler
(
self
.
fn
)
rh
.
emit
(
self
.
next_rec
())
self
.
assertLogFile
(
self
.
fn
)
rh
.
close
()
def
test_rollover_filenames
(
self
):
rh
=
logging
.
handlers
.
RotatingFileHandler
(
...
...
@@ -1979,6 +1982,7 @@ class RotatingFileHandlerTest(BaseFileTest):
rh
.
emit
(
self
.
next_rec
())
self
.
assertLogFile
(
self
.
fn
+
".2"
)
self
.
assertFalse
(
os
.
path
.
exists
(
self
.
fn
+
".3"
))
rh
.
close
()
class
TimedRotatingFileHandlerTest
(
BaseFileTest
):
# test methods added below
...
...
@@ -1998,6 +2002,7 @@ for when, exp in (('S', 1),
rh
=
logging
.
handlers
.
TimedRotatingFileHandler
(
self
.
fn
,
when
=
when
,
interval
=
1
,
backupCount
=
0
)
self
.
assertEquals
(
exp
,
rh
.
computeRollover
(
0.0
))
rh
.
close
()
setattr
(
TimedRotatingFileHandlerTest
,
"test_compute_rollover_
%
s"
%
when
,
test_compute_rollover
)
# 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