Kaydet (Commit) c8bf8842 authored tarafından Guido van Rossum's avatar Guido van Rossum

Added test for __all__.

üst e632380b
......@@ -29,3 +29,10 @@ t5.string loading
['__builtins__', '__doc__', '__file__', '__name__', '__path__', 'foo', 'string', 't5']
['__builtins__', '__doc__', '__file__', '__name__', 'string']
['__builtins__', '__doc__', '__file__', '__name__', 'spam']
running test t6
['__all__', '__builtins__', '__doc__', '__file__', '__name__', '__path__']
t6.spam loading
t6.ham loading
t6.eggs loading
['__all__', '__builtins__', '__doc__', '__file__', '__name__', '__path__', 'eggs', 'ham', 'spam']
['eggs', 'ham', 'spam', 't6']
......@@ -146,6 +146,21 @@ import t5
print dir(t5)
print dir(t5.foo)
print dir(t5.string)
"""),
("t6", [
("t6", None),
("t6 __init__.py", "__all__ = ['spam', 'ham', 'eggs']"),
("t6 spam.py", "print __name__, 'loading'"),
("t6 ham.py", "print __name__, 'loading'"),
("t6 eggs.py", "print __name__, 'loading'"),
],
"""
import t6
print dir(t6)
from t6 import *
print dir(t6)
print dir()
"""),
]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment