[Python-checkins] cpython (2.7): fix this to not depend on dictionary order

benjamin.peterson python-checkins at python.org
Tue Jan 3 23:28:59 CET 2012


http://hg.python.org/cpython/rev/789d59773801
changeset:   74256:789d59773801
branch:      2.7
parent:      74252:f9122975fd80
user:        Benjamin Peterson <benjamin at python.org>
date:        Tue Jan 03 16:23:11 2012 -0600
summary:
  fix this to not depend on dictionary order

files:
  Lib/test/test_symtable.py |  8 ++++----
  1 files changed, 4 insertions(+), 4 deletions(-)


diff --git a/Lib/test/test_symtable.py b/Lib/test/test_symtable.py
--- a/Lib/test/test_symtable.py
+++ b/Lib/test/test_symtable.py
@@ -88,10 +88,10 @@
 
     def test_function_info(self):
         func = self.spam
-        self.assertEqual(func.get_parameters(), ("a", "b", "kw", "var"))
-        self.assertEqual(func.get_locals(),
-                         ("a", "b", "internal", "kw", "var", "x"))
-        self.assertEqual(func.get_globals(), ("bar", "glob"))
+        self.assertEqual(sorted(func.get_parameters()), ["a", "b", "kw", "var"])
+        expected = ["a", "b", "internal", "kw", "var", "x"]
+        self.assertEqual(sorted(func.get_locals()), expected)
+        self.assertEqual(sorted(func.get_globals()), ["bar", "glob"])
         self.assertEqual(self.internal.get_frees(), ("x",))
 
     def test_globals(self):

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list