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
79618239
Kaydet (Commit)
79618239
authored
May 06, 2008
tarafından
Brett Cannon
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
When testing a module's __all__, we really don't care if it is deprecated.
üst
af748c3a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
15 deletions
+10
-15
test___all__.py
Lib/test/test___all__.py
+10
-15
No files found.
Lib/test/test___all__.py
Dosyayı görüntüle @
79618239
import
unittest
import
unittest
from
test.test_support
import
run_unittest
from
test.test_support
import
run_unittest
,
catch_warning
import
sys
import
sys
import
warnings
import
warnings
warnings
.
filterwarnings
(
"ignore"
,
"the sets module is deprecated"
,
DeprecationWarning
,
"<string>"
)
warnings
.
filterwarnings
(
"ignore"
,
".*popen2 module is deprecated.*"
,
DeprecationWarning
)
warnings
.
filterwarnings
(
"ignore"
,
"the MimeWriter module is deprecated.*"
,
DeprecationWarning
)
warnings
.
filterwarnings
(
"ignore"
,
"the mimify module is deprecated.*"
,
DeprecationWarning
)
class
AllTest
(
unittest
.
TestCase
):
class
AllTest
(
unittest
.
TestCase
):
def
check_all
(
self
,
modname
):
def
check_all
(
self
,
modname
):
names
=
{}
names
=
{}
try
:
with
catch_warning
():
exec
"import
%
s"
%
modname
in
names
warnings
.
filterwarnings
(
"ignore"
,
".* module"
,
DeprecationWarning
)
except
ImportError
:
try
:
# Silent fail here seems the best route since some modules
exec
"import
%
s"
%
modname
in
names
# may not be available in all environments.
except
ImportError
:
return
# Silent fail here seems the best route since some modules
# may not be available in all environments.
return
self
.
failUnless
(
hasattr
(
sys
.
modules
[
modname
],
"__all__"
),
self
.
failUnless
(
hasattr
(
sys
.
modules
[
modname
],
"__all__"
),
"
%
s has no __all__ attribute"
%
modname
)
"
%
s has no __all__ attribute"
%
modname
)
names
=
{}
names
=
{}
...
...
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