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
9788e860
Kaydet (Commit)
9788e860
authored
Kas 16, 2013
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #19594: Use specific asserts in unittest tests.
üst
52bbeacb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
9 deletions
+9
-9
test_case.py
Lib/unittest/test/test_case.py
+6
-6
test_loader.py
Lib/unittest/test/test_loader.py
+1
-1
test_result.py
Lib/unittest/test/test_result.py
+2
-2
No files found.
Lib/unittest/test/test_case.py
Dosyayı görüntüle @
9788e860
...
...
@@ -293,7 +293,7 @@ class Test_TestCase(unittest.TestCase, TestEquality, TestHashing):
def
test
(
self
):
pass
self
.
assert
True
(
Foo
(
'test'
)
.
failureException
is
AssertionError
)
self
.
assert
Is
(
Foo
(
'test'
)
.
failureException
,
AssertionError
)
# "This class attribute gives the exception raised by the test() method.
# If a test framework needs to use a specialized exception, possibly to
...
...
@@ -311,7 +311,7 @@ class Test_TestCase(unittest.TestCase, TestEquality, TestHashing):
failureException
=
RuntimeError
self
.
assert
True
(
Foo
(
'test'
)
.
failureException
is
RuntimeError
)
self
.
assert
Is
(
Foo
(
'test'
)
.
failureException
,
RuntimeError
)
Foo
(
'test'
)
.
run
(
result
)
...
...
@@ -334,7 +334,7 @@ class Test_TestCase(unittest.TestCase, TestEquality, TestHashing):
failureException
=
RuntimeError
self
.
assert
True
(
Foo
(
'test'
)
.
failureException
is
RuntimeError
)
self
.
assert
Is
(
Foo
(
'test'
)
.
failureException
,
RuntimeError
)
Foo
(
'test'
)
.
run
(
result
)
...
...
@@ -607,7 +607,7 @@ class Test_TestCase(unittest.TestCase, TestEquality, TestHashing):
msg
=
e
.
args
[
0
]
else
:
self
.
fail
(
'assertSequenceEqual did not fail.'
)
self
.
assert
True
(
len
(
msg
)
<
len
(
diff
))
self
.
assert
Less
(
len
(
msg
),
len
(
diff
))
self
.
assertIn
(
omitted
,
msg
)
self
.
maxDiff
=
len
(
diff
)
*
2
...
...
@@ -617,7 +617,7 @@ class Test_TestCase(unittest.TestCase, TestEquality, TestHashing):
msg
=
e
.
args
[
0
]
else
:
self
.
fail
(
'assertSequenceEqual did not fail.'
)
self
.
assert
True
(
len
(
msg
)
>
len
(
diff
))
self
.
assert
Greater
(
len
(
msg
),
len
(
diff
))
self
.
assertNotIn
(
omitted
,
msg
)
self
.
maxDiff
=
None
...
...
@@ -627,7 +627,7 @@ class Test_TestCase(unittest.TestCase, TestEquality, TestHashing):
msg
=
e
.
args
[
0
]
else
:
self
.
fail
(
'assertSequenceEqual did not fail.'
)
self
.
assert
True
(
len
(
msg
)
>
len
(
diff
))
self
.
assert
Greater
(
len
(
msg
),
len
(
diff
))
self
.
assertNotIn
(
omitted
,
msg
)
def
testTruncateMessage
(
self
):
...
...
Lib/unittest/test/test_loader.py
Dosyayı görüntüle @
9788e860
...
...
@@ -1279,7 +1279,7 @@ class Test_TestLoader(unittest.TestCase):
# "The default value is the TestSuite class"
def
test_suiteClass__default_value
(
self
):
loader
=
unittest
.
TestLoader
()
self
.
assert
True
(
loader
.
suiteClass
is
unittest
.
TestSuite
)
self
.
assert
Is
(
loader
.
suiteClass
,
unittest
.
TestSuite
)
# Make sure the dotted name resolution works even if the actual
# function doesn't have the same name as is used to find it.
...
...
Lib/unittest/test/test_result.py
Dosyayı görüntüle @
9788e860
...
...
@@ -176,7 +176,7 @@ class Test_TestResult(unittest.TestCase):
self
.
assertEqual
(
result
.
shouldStop
,
False
)
test_case
,
formatted_exc
=
result
.
failures
[
0
]
self
.
assert
True
(
test_case
is
test
)
self
.
assert
Is
(
test_case
,
test
)
self
.
assertIsInstance
(
formatted_exc
,
str
)
# "addError(test, err)"
...
...
@@ -224,7 +224,7 @@ class Test_TestResult(unittest.TestCase):
self
.
assertEqual
(
result
.
shouldStop
,
False
)
test_case
,
formatted_exc
=
result
.
errors
[
0
]
self
.
assert
True
(
test_case
is
test
)
self
.
assert
Is
(
test_case
,
test
)
self
.
assertIsInstance
(
formatted_exc
,
str
)
def
testGetDescriptionWithoutDocstring
(
self
):
...
...
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