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
f3e4b62d
Kaydet (Commit)
f3e4b62d
authored
Agu 05, 2013
tarafından
Mark Dickinson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #18659: Backed out changeset cfd875bcbe41 after buildbot failures.
üst
a9e626f7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
test_format.py
Lib/test/test_format.py
+7
-3
No files found.
Lib/test/test_format.py
Dosyayı görüntüle @
f3e4b62d
...
@@ -327,6 +327,10 @@ class FormatTest(unittest.TestCase):
...
@@ -327,6 +327,10 @@ class FormatTest(unittest.TestCase):
self
.
assertIs
(
text
%
(),
text
)
self
.
assertIs
(
text
%
(),
text
)
self
.
assertIs
(
text
.
format
(),
text
)
self
.
assertIs
(
text
.
format
(),
text
)
def
test_main
():
support
.
run_unittest
(
FormatTest
)
def
test_precision
(
self
):
def
test_precision
(
self
):
INT_MAX
=
2147483647
INT_MAX
=
2147483647
...
@@ -338,10 +342,10 @@ class FormatTest(unittest.TestCase):
...
@@ -338,10 +342,10 @@ class FormatTest(unittest.TestCase):
self
.
assertEqual
(
str
(
cm
.
exception
),
"precision too big"
)
self
.
assertEqual
(
str
(
cm
.
exception
),
"precision too big"
)
c
=
complex
(
f
)
c
=
complex
(
f
)
self
.
assertEqual
(
format
(
c
,
".0f"
),
"1+0j
"
)
self
.
assertEqual
(
format
(
f
,
".0f"
),
"1
"
)
self
.
assertEqual
(
format
(
c
,
".3f"
),
"1.200+0.000j
"
)
self
.
assertEqual
(
format
(
f
,
".3f"
),
"1.200
"
)
with
self
.
assertRaises
(
ValueError
)
as
cm
:
with
self
.
assertRaises
(
ValueError
)
as
cm
:
format
(
c
,
".
%
sf"
%
(
INT_MAX
+
1
))
format
(
f
,
".
%
sf"
%
(
INT_MAX
+
1
))
self
.
assertEqual
(
str
(
cm
.
exception
),
"precision too big"
)
self
.
assertEqual
(
str
(
cm
.
exception
),
"precision too big"
)
...
...
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