diff options
author | Raymond Hettinger <python@rcn.com> | 2003-05-02 09:06:28 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2003-05-02 09:06:28 (GMT) |
commit | 91bbd9a7b9735cba07b06400a7c467aab6facfde (patch) | |
tree | 14bbad407135d461d54f8e1c066a93c6b9ef363d /Lib/test/test___all__.py | |
parent | 40006e9f7a38bbbcf564c541cb0f2022b952e409 (diff) | |
download | cpython-91bbd9a7b9735cba07b06400a7c467aab6facfde.zip cpython-91bbd9a7b9735cba07b06400a7c467aab6facfde.tar.gz cpython-91bbd9a7b9735cba07b06400a7c467aab6facfde.tar.bz2 |
Used sets.Set() to compare unordered sequences.
Improves clarity and brevity.
Diffstat (limited to 'Lib/test/test___all__.py')
-rw-r--r-- | Lib/test/test___all__.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/test/test___all__.py b/Lib/test/test___all__.py index 66e6eeb..e9cb093 100644 --- a/Lib/test/test___all__.py +++ b/Lib/test/test___all__.py @@ -2,6 +2,7 @@ import unittest from test import test_support from test.test_support import verify, verbose +from sets import Set import sys import warnings @@ -42,10 +43,8 @@ class AllTest(unittest.TestCase): exec "from %s import *" % modname in names if names.has_key("__builtins__"): del names["__builtins__"] - keys = names.keys() - keys.sort() - all = list(sys.modules[modname].__all__) # in case it's a tuple - all.sort() + keys = Set(names) + all = Set(sys.modules[modname].__all__) verify(keys==all, "%s != %s" % (keys, all)) def test_all(self): |