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
fafd874b
Kaydet (Commit)
fafd874b
authored
Agu 28, 2004
tarafından
Jim Fulton
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added an __iter__ method for test suites.
üst
9f556a40
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
0 deletions
+34
-0
test_unittest.py
Lib/test/test_unittest.py
+31
-0
unittest.py
Lib/unittest.py
+3
-0
No files found.
Lib/test/test_unittest.py
0 → 100644
Dosyayı görüntüle @
fafd874b
"""Test script for unittest.
This just includes tests for new features. We really need a
full set of tests.
"""
import
unittest
def
test_TestSuite_iter
():
"""
>>> test1 = unittest.FunctionTestCase(lambda: None)
>>> test2 = unittest.FunctionTestCase(lambda: None)
>>> suite = unittest.TestSuite((test1, test2))
>>> tests = []
>>> for test in suite:
... tests.append(test)
>>> tests == [test1, test2]
True
"""
######################################################################
## Main
######################################################################
def
test_main
():
from
test
import
test_support
,
test_unittest
test_support
.
run_doctest
(
test_unittest
,
verbosity
=
True
)
if
__name__
==
'__main__'
:
test_main
()
Lib/unittest.py
Dosyayı görüntüle @
fafd874b
...
...
@@ -400,6 +400,9 @@ class TestSuite:
__str__
=
__repr__
def
__iter__
(
self
):
return
iter
(
self
.
_tests
)
def
countTestCases
(
self
):
cases
=
0
for
test
in
self
.
_tests
:
...
...
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