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
9c164af6
Kaydet (Commit)
9c164af6
authored
May 08, 2010
tarafından
Michael Foord
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
unittest: issue 8301. Adding functions to test suites no longer crashes.
üst
7daf0e4a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
suite.py
Lib/unittest/suite.py
+6
-1
test_suite.py
Lib/unittest/test/test_suite.py
+9
-0
No files found.
Lib/unittest/suite.py
Dosyayı görüntüle @
9c164af6
...
...
@@ -119,7 +119,12 @@ class TestSuite(BaseTestSuite):
if
getattr
(
currentClass
,
"__unittest_skip__"
,
False
):
return
currentClass
.
_classSetupFailed
=
False
try
:
currentClass
.
_classSetupFailed
=
False
except
TypeError
:
# test may actually be a function
# so its class will be a builtin-type
pass
setUpClass
=
getattr
(
currentClass
,
'setUpClass'
,
None
)
if
setUpClass
is
not
None
:
...
...
Lib/unittest/test/test_suite.py
Dosyayı görüntüle @
9c164af6
...
...
@@ -290,6 +290,15 @@ class Test_TestSuite(unittest.TestCase, TestEquality):
suite
=
unittest
.
TestSuite
()
self
.
assertRaises
(
TypeError
,
suite
.
addTests
,
"foo"
)
def
test_function_in_suite
(
self
):
def
f
(
_
):
pass
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
f
)
# when the bug is fixed this line will not crash
suite
.
run
(
unittest
.
TestResult
())
if
__name__
==
'__main__'
:
unittest
.
main
()
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