@@ -147,7 +147,7 @@ def test_formatting_takes_just_last_part(self):
147147
148148class MockNumPy (object ):
149149 """
150- This is a mock numpy object that raises an error when it is trying to be converted to a boolean.
150+ This is a mock numpy object that raises an error when there is an atempt to convert it to a boolean.
151151 """
152152 def __nonzero__ (self ):
153153 raise ValueError ("The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()" )
@@ -158,25 +158,20 @@ class TestDictKeyCompletion(unittest.TestCase):
158158 def test_set_of_keys_returned_when_matches_found (self ):
159159 com = autocomplete .DictKeyCompletion ()
160160 local = {'d' :{"ab" :1 , "cd" :2 },}
161- result = com .matches (2 ,"d[" , local )
162- self .assertSetEqual (result ,set (["'ab'" ,"'cd'" ]))
161+ com .matches (2 ,"d[" , local )
162+ self .assertSetEqual (com . matches ( 2 , "d[" , local ) ,set (["'ab'" ,"'cd'" ]))
163163
164164 def test_empty_set_returned_when_eval_error (self ):
165165 com = autocomplete .DictKeyCompletion ()
166166 local = {'e' :{"ab" :1 , "cd" :2 },}
167- result = com .matches (2 ,"d[" , local )
168- self .assertSetEqual (result ,set ())
167+ self .assertSetEqual (com .matches (2 ,"d[" , local ),set ())
169168
170169 def test_empty_set_returned_when_not_dict_type (self ):
171170 com = autocomplete .DictKeyCompletion ()
172171 local = {'l' :["ab" , "cd" ],}
173- result = com .matches (2 ,"l[" , local )
174- self .assertSetEqual (result ,set ())
172+ self .assertSetEqual (com .matches (2 ,"l[" , local ),set ())
175173
176- def test_obj_that_does_not_allow_bool_tests (self ):
174+ def test_obj_that_does_not_allow_conversion_to_bool (self ):
177175 com = autocomplete .DictKeyCompletion ()
178176 local = {'mNumPy' :MockNumPy (),}
179- try :
180- com .matches (7 ,"mNumPy[" , local )
181- except ValueError :
182- raise AssertionError ("Dict key completion raised value error." )
177+ self .assertSetEqual (com .matches (7 ,"mNumPy[" , local ), set ())
0 commit comments