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
d5991421
Kaydet (Commit)
d5991421
authored
Agu 11, 2013
tarafından
Ezio Melotti
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#18663: document that assertAlmostEqual also works when the values are equal and add tests.
üst
bb8114cb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
unittest.rst
Doc/library/unittest.rst
+1
-1
test_assertions.py
Lib/unittest/test/test_assertions.py
+4
-0
No files found.
Doc/library/unittest.rst
Dosyayı görüntüle @
d5991421
...
@@ -1017,7 +1017,7 @@ Test cases
...
@@ -1017,7 +1017,7 @@ Test cases
like the :func:`round` function) and not *significant digits*.
like the :func:`round` function) and not *significant digits*.
If *delta* is supplied instead of *places* then the difference
If *delta* is supplied instead of *places* then the difference
between *first* and *second* must be less
(or more) than
*delta*.
between *first* and *second* must be less
or equal to (or greater than)
*delta*.
Supplying both *delta* and *places* raises a ``TypeError``.
Supplying both *delta* and *places* raises a ``TypeError``.
...
...
Lib/unittest/test/test_assertions.py
Dosyayı görüntüle @
d5991421
...
@@ -33,6 +33,10 @@ class Test_Assertions(unittest.TestCase):
...
@@ -33,6 +33,10 @@ class Test_Assertions(unittest.TestCase):
self
.
assertNotAlmostEqual
(
1.1
,
1.0
,
delta
=
0.05
)
self
.
assertNotAlmostEqual
(
1.1
,
1.0
,
delta
=
0.05
)
self
.
assertNotAlmostEqual
(
1.0
,
1.1
,
delta
=
0.05
)
self
.
assertNotAlmostEqual
(
1.0
,
1.1
,
delta
=
0.05
)
self
.
assertAlmostEqual
(
1.0
,
1.0
,
delta
=
0.5
)
self
.
assertRaises
(
self
.
failureException
,
self
.
assertNotAlmostEqual
,
1.0
,
1.0
,
delta
=
0.5
)
self
.
assertRaises
(
self
.
failureException
,
self
.
assertAlmostEqual
,
self
.
assertRaises
(
self
.
failureException
,
self
.
assertAlmostEqual
,
1.1
,
1.0
,
delta
=
0.05
)
1.1
,
1.0
,
delta
=
0.05
)
self
.
assertRaises
(
self
.
failureException
,
self
.
assertNotAlmostEqual
,
self
.
assertRaises
(
self
.
failureException
,
self
.
assertNotAlmostEqual
,
...
...
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