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
37eb3387
Kaydet (Commit)
37eb3387
authored
Nis 26, 2011
tarafından
Vinay Sajip
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Refined time test in test_logging.
üst
373baef1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
test_logging.py
Lib/test/test_logging.py
+16
-1
No files found.
Lib/test/test_logging.py
Dosyayı görüntüle @
37eb3387
...
...
@@ -43,6 +43,7 @@ import tempfile
from
test.support
import
captured_stdout
,
run_with_locale
,
run_unittest
,
patch
from
test.support
import
TestHandler
,
Matcher
import
textwrap
import
time
import
unittest
import
warnings
import
weakref
...
...
@@ -2190,6 +2191,18 @@ class QueueHandlerTest(BaseTest):
self
.
assertTrue
(
handler
.
matches
(
levelno
=
logging
.
ERROR
,
message
=
'2'
))
self
.
assertTrue
(
handler
.
matches
(
levelno
=
logging
.
CRITICAL
,
message
=
'3'
))
ZERO
=
datetime
.
timedelta
(
0
)
class
UTC
(
datetime
.
tzinfo
):
def
utcoffset
(
self
,
dt
):
return
ZERO
dst
=
utcoffset
def
tzname
(
self
,
dt
):
return
'UTC'
utc
=
UTC
()
class
FormatterTest
(
unittest
.
TestCase
):
def
setUp
(
self
):
...
...
@@ -2268,9 +2281,11 @@ class FormatterTest(unittest.TestCase):
def
test_time
(
self
):
r
=
self
.
get_record
()
r
.
created
=
735375780.0
# 21 April 1993 08:03:00
dt
=
datetime
.
datetime
(
1993
,
4
,
21
,
8
,
3
,
0
,
0
,
utc
)
r
.
created
=
time
.
mktime
(
dt
.
utctimetuple
())
r
.
msecs
=
123
f
=
logging
.
Formatter
(
'
%(asctime)
s
%(message)
s'
)
f
.
converter
=
time
.
gmtime
self
.
assertEqual
(
f
.
formatTime
(
r
),
'1993-04-21 08:03:00,123'
)
self
.
assertEqual
(
f
.
formatTime
(
r
,
'
%
Y:
%
d'
),
'1993:21'
)
f
.
format
(
r
)
...
...
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