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
3044fa77
Kaydet (Commit)
3044fa77
authored
Ara 18, 2010
tarafından
Ezio Melotti
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use lowercase true/false in assertTrue/assertFalse messages.
üst
b68a7bc7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
case.py
Lib/unittest/case.py
+4
-4
test_assertions.py
Lib/unittest/test/test_assertions.py
+4
-4
No files found.
Lib/unittest/case.py
Dosyayı görüntüle @
3044fa77
...
@@ -477,15 +477,15 @@ class TestCase(object):
...
@@ -477,15 +477,15 @@ class TestCase(object):
raise
self
.
failureException
(
msg
)
raise
self
.
failureException
(
msg
)
def
assertFalse
(
self
,
expr
,
msg
=
None
):
def
assertFalse
(
self
,
expr
,
msg
=
None
):
"
Fail the test if the expression is true.
"
"
""Check that the expression is false.""
"
if
expr
:
if
expr
:
msg
=
self
.
_formatMessage
(
msg
,
"
%
s is not
F
alse"
%
safe_repr
(
expr
))
msg
=
self
.
_formatMessage
(
msg
,
"
%
s is not
f
alse"
%
safe_repr
(
expr
))
raise
self
.
failureException
(
msg
)
raise
self
.
failureException
(
msg
)
def
assertTrue
(
self
,
expr
,
msg
=
None
):
def
assertTrue
(
self
,
expr
,
msg
=
None
):
"""
Fail the test unless
the expression is true."""
"""
Check that
the expression is true."""
if
not
expr
:
if
not
expr
:
msg
=
self
.
_formatMessage
(
msg
,
"
%
s is not
T
rue"
%
safe_repr
(
expr
))
msg
=
self
.
_formatMessage
(
msg
,
"
%
s is not
t
rue"
%
safe_repr
(
expr
))
raise
self
.
failureException
(
msg
)
raise
self
.
failureException
(
msg
)
def
_formatMessage
(
self
,
msg
,
standardMsg
):
def
_formatMessage
(
self
,
msg
,
standardMsg
):
...
...
Lib/unittest/test/test_assertions.py
Dosyayı görüntüle @
3044fa77
...
@@ -166,13 +166,13 @@ class TestLongMessage(unittest.TestCase):
...
@@ -166,13 +166,13 @@ class TestLongMessage(unittest.TestCase):
def
testAssertTrue
(
self
):
def
testAssertTrue
(
self
):
self
.
assertMessages
(
'assertTrue'
,
(
False
,),
self
.
assertMessages
(
'assertTrue'
,
(
False
,),
[
"^False is not
True$"
,
"^oops$"
,
"^False is not T
rue$"
,
[
"^False is not
true$"
,
"^oops$"
,
"^False is not t
rue$"
,
"^False is not
T
rue : oops$"
])
"^False is not
t
rue : oops$"
])
def
testAssertFalse
(
self
):
def
testAssertFalse
(
self
):
self
.
assertMessages
(
'assertFalse'
,
(
True
,),
self
.
assertMessages
(
'assertFalse'
,
(
True
,),
[
"^True is not
False$"
,
"^oops$"
,
"^True is not F
alse$"
,
[
"^True is not
false$"
,
"^oops$"
,
"^True is not f
alse$"
,
"^True is not
F
alse : oops$"
])
"^True is not
f
alse : oops$"
])
def
testNotEqual
(
self
):
def
testNotEqual
(
self
):
self
.
assertMessages
(
'assertNotEqual'
,
(
1
,
1
),
self
.
assertMessages
(
'assertNotEqual'
,
(
1
,
1
),
...
...
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