From c8bf884248e58f0d61ac020c60be01b048c60b2b Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 8 Sep 1997 16:06:20 +0000 Subject: Added test for __all__. --- Lib/test/output/test_pkg | 7 +++++++ Lib/test/test_pkg.py | 15 +++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/Lib/test/output/test_pkg b/Lib/test/output/test_pkg index b1033c1..4cb503e 100644 --- a/Lib/test/output/test_pkg +++ b/Lib/test/output/test_pkg @@ -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'] diff --git a/Lib/test/test_pkg.py b/Lib/test/test_pkg.py index f078714..0356cfa 100644 --- a/Lib/test/test_pkg.py +++ b/Lib/test/test_pkg.py @@ -148,6 +148,21 @@ 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() +"""), + ] nontests = [ -- cgit v0.12