From: Georg Brandl Date: Thu, 21 Oct 2010 07:40:03 +0000 (+0000) Subject: #10159: sort completion matches before comparing to dir() result. X-Git-Tag: v3.2a4~403 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=50de5f56a9eba0e0da6fb48c22b85ee69daac105;p=thirdparty%2FPython%2Fcpython.git #10159: sort completion matches before comparing to dir() result. --- diff --git a/Lib/test/test_rlcompleter.py b/Lib/test/test_rlcompleter.py index 29e6a1b2e780..11a7bd2f719c 100644 --- a/Lib/test/test_rlcompleter.py +++ b/Lib/test/test_rlcompleter.py @@ -31,9 +31,9 @@ class TestRlcompleter(unittest.TestCase): def test_global_matches(self): # test with builtins namespace - self.assertEqual(self.stdcompleter.global_matches('di'), + self.assertEqual(sorted(self.stdcompleter.global_matches('di')), [x+'(' for x in dir(builtins) if x.startswith('di')]) - self.assertEqual(self.stdcompleter.global_matches('st'), + self.assertEqual(sorted(self.stdcompleter.global_matches('st')), [x+'(' for x in dir(builtins) if x.startswith('st')]) self.assertEqual(self.stdcompleter.global_matches('akaksajadhak'), [])