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
ed52f6cb
Kaydet (Commit)
ed52f6cb
authored
May 01, 2013
tarafından
Ezio Melotti
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#11078: test___all__ now checks for duplicates in __all__. Initial patch by R. David Murray.
üst
4c09c2cb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
11 deletions
+17
-11
test___all__.py
Lib/test/test___all__.py
+14
-11
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/test/test___all__.py
Dosyayı görüntüle @
ed52f6cb
...
...
@@ -29,17 +29,20 @@ class AllTest(unittest.TestCase):
if
not
hasattr
(
sys
.
modules
[
modname
],
"__all__"
):
raise
NoAll
(
modname
)
names
=
{}
try
:
exec
(
"from
%
s import *"
%
modname
,
names
)
except
Exception
as
e
:
# Include the module name in the exception string
self
.
fail
(
"__all__ failure in {}: {}: {}"
.
format
(
modname
,
e
.
__class__
.
__name__
,
e
))
if
"__builtins__"
in
names
:
del
names
[
"__builtins__"
]
keys
=
set
(
names
)
all
=
set
(
sys
.
modules
[
modname
]
.
__all__
)
self
.
assertEqual
(
keys
,
all
)
with
self
.
subTest
(
module
=
modname
):
try
:
exec
(
"from
%
s import *"
%
modname
,
names
)
except
Exception
as
e
:
# Include the module name in the exception string
self
.
fail
(
"__all__ failure in {}: {}: {}"
.
format
(
modname
,
e
.
__class__
.
__name__
,
e
))
if
"__builtins__"
in
names
:
del
names
[
"__builtins__"
]
keys
=
set
(
names
)
all_list
=
sys
.
modules
[
modname
]
.
__all__
all_set
=
set
(
all_list
)
self
.
assertCountEqual
(
all_set
,
all_list
,
"in module {}"
.
format
(
modname
))
self
.
assertEqual
(
keys
,
all_set
,
"in module {}"
.
format
(
modname
))
def
walk_modules
(
self
,
basedir
,
modpath
):
for
fn
in
sorted
(
os
.
listdir
(
basedir
)):
...
...
Misc/NEWS
Dosyayı görüntüle @
ed52f6cb
...
...
@@ -176,6 +176,9 @@ Library
Tests
-----
-
Issue
#
11078
:
test___all__
now
checks
for
duplicates
in
__all__
.
Initial
patch
by
R
.
David
Murray
.
-
Issue
#
17712
:
Fix
test_gdb
failures
on
Ubuntu
13.04
.
-
Issue
#
17835
:
Fix
test_io
when
the
default
OS
pipe
buffer
size
is
larger
...
...
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