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
e54371e2
Kaydet (Commit)
e54371e2
authored
Kas 11, 2011
tarafından
Florent Xicluna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use unittest.skipUnless to skip the test related to the glibc bug, issue #13309.
üst
4ff29db2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
test_time.py
Lib/test/test_time.py
+13
-12
No files found.
Lib/test/test_time.py
Dosyayı görüntüle @
e54371e2
...
@@ -4,7 +4,6 @@ import unittest
...
@@ -4,7 +4,6 @@ import unittest
import
locale
import
locale
import
sysconfig
import
sysconfig
import
sys
import
sys
import
warnings
import
platform
import
platform
# Max year is only limited by the size of C int.
# Max year is only limited by the size of C int.
...
@@ -200,8 +199,8 @@ class TimeTestCase(unittest.TestCase):
...
@@ -200,8 +199,8 @@ class TimeTestCase(unittest.TestCase):
else
:
else
:
self
.
assertEqual
(
time
.
ctime
(
testval
)[
20
:],
str
(
year
))
self
.
assertEqual
(
time
.
ctime
(
testval
)[
20
:],
str
(
year
))
@unittest.skip
If
(
not
hasattr
(
time
,
"tzset"
),
@unittest.skip
Unless
(
hasattr
(
time
,
"tzset"
),
"time module has no attribute tzset"
)
"time module has no attribute tzset"
)
def
test_tzset
(
self
):
def
test_tzset
(
self
):
from
os
import
environ
from
os
import
environ
...
@@ -298,8 +297,7 @@ class TimeTestCase(unittest.TestCase):
...
@@ -298,8 +297,7 @@ class TimeTestCase(unittest.TestCase):
t1
=
time
.
mktime
(
lt1
)
t1
=
time
.
mktime
(
lt1
)
self
.
assertAlmostEqual
(
t1
,
t0
,
delta
=
0.2
)
self
.
assertAlmostEqual
(
t1
,
t0
,
delta
=
0.2
)
# XXX run last to work around issue #13309 on Gentoo
def
test_mktime
(
self
):
def
test_zzz_mktime
(
self
):
# Issue #1726687
# Issue #1726687
for
t
in
(
-
2
,
-
1
,
0
,
1
):
for
t
in
(
-
2
,
-
1
,
0
,
1
):
try
:
try
:
...
@@ -308,20 +306,23 @@ class TimeTestCase(unittest.TestCase):
...
@@ -308,20 +306,23 @@ class TimeTestCase(unittest.TestCase):
pass
pass
else
:
else
:
self
.
assertEqual
(
time
.
mktime
(
tt
),
t
)
self
.
assertEqual
(
time
.
mktime
(
tt
),
t
)
tt
=
time
.
gmtime
(
self
.
t
)
tzname
=
time
.
strftime
(
'
%
Z'
,
tt
)
# Issue #13309: passing extreme values to mktime() or localtime()
self
.
assertNotEqual
(
tzname
,
'LMT'
)
# borks the glibc's internal timezone data.
@unittest.skipUnless
(
platform
.
libc_ver
()[
0
]
!=
'glibc'
,
"disabled because of a bug in glibc. Issue #13309"
)
def
test_mktime_error
(
self
):
# It may not be possible to reliably make mktime return error
# It may not be possible to reliably make mktime return error
# on all platfom. This will make sure that no other exception
# on all platfom. This will make sure that no other exception
# than OverflowError is raised for an extreme value.
# than OverflowError is raised for an extreme value.
if
platform
.
libc_ver
()[
0
]
==
'glibc'
:
tt
=
time
.
gmtime
(
self
.
t
)
# Issue #13309: passing extreme values to mktime() or localtime()
tzname
=
time
.
strftime
(
'
%
Z'
,
tt
)
# borks the glibc's internal timezone data.
self
.
assertNotEqual
(
tzname
,
'LMT'
)
return
try
:
try
:
time
.
mktime
((
-
1
,
1
,
1
,
0
,
0
,
0
,
-
1
,
-
1
,
-
1
))
time
.
mktime
((
-
1
,
1
,
1
,
0
,
0
,
0
,
-
1
,
-
1
,
-
1
))
except
OverflowError
:
except
OverflowError
:
pass
pass
self
.
assertEqual
(
time
.
strftime
(
'
%
Z'
,
tt
),
tzname
)
class
TestLocale
(
unittest
.
TestCase
):
class
TestLocale
(
unittest
.
TestCase
):
...
...
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