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
67911370
Kaydet (Commit)
67911370
authored
Eyl 30, 2002
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Now that TestCase is a new-style class, change loadTestsFromModule and
loadTestsFromName to accept new-style classes too!
üst
42d1d3ed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
unittest.py
Lib/unittest.py
+4
-2
No files found.
Lib/unittest.py
Dosyayı görüntüle @
67911370
...
...
@@ -422,7 +422,8 @@ class TestLoader:
tests
=
[]
for
name
in
dir
(
module
):
obj
=
getattr
(
module
,
name
)
if
type
(
obj
)
==
types
.
ClassType
and
issubclass
(
obj
,
TestCase
):
if
(
isinstance
(
obj
,
(
type
,
types
.
ClassType
))
and
issubclass
(
obj
,
TestCase
)):
tests
.
append
(
self
.
loadTestsFromTestCase
(
obj
))
return
self
.
suiteClass
(
tests
)
...
...
@@ -456,7 +457,8 @@ class TestLoader:
import
unittest
if
type
(
obj
)
==
types
.
ModuleType
:
return
self
.
loadTestsFromModule
(
obj
)
elif
type
(
obj
)
==
types
.
ClassType
and
issubclass
(
obj
,
unittest
.
TestCase
):
elif
(
isinstance
(
obj
,
(
type
,
types
.
ClassType
))
and
issubclass
(
obj
,
unittest
.
TestCase
)):
return
self
.
loadTestsFromTestCase
(
obj
)
elif
type
(
obj
)
==
types
.
UnboundMethodType
:
return
obj
.
im_class
(
obj
.
__name__
)
...
...
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