@@ -110,7 +110,7 @@ def test_two_completers_get_both(self):
110110 a = self .completer (["a" ])
111111 b = self .completer (["b" ])
112112 cumulative = autocomplete .CumulativeCompleter ([a , b ])
113- self .assertEqual (cumulative .matches (3 , "abc" ), set ([ "a" , "b" ]) )
113+ self .assertEqual (cumulative .matches (3 , "abc" ), { "a" , "b" } )
114114
115115
116116class TestFilenameCompletion (unittest .TestCase ):
@@ -187,7 +187,7 @@ def test_set_of_keys_returned_when_matches_found(self):
187187 com = autocomplete .DictKeyCompletion ()
188188 local = {"d" : {"ab" : 1 , "cd" : 2 }}
189189 self .assertSetEqual (
190- com .matches (2 , "d[" , locals_ = local ), set ([ "'ab']" , "'cd']" ])
190+ com .matches (2 , "d[" , locals_ = local ), { "'ab']" , "'cd']" }
191191 )
192192
193193 def test_none_returned_when_eval_error (self ):
@@ -254,27 +254,27 @@ def setUpClass(cls):
254254 def test_att_matches_found_on_instance (self ):
255255 self .assertSetEqual (
256256 self .com .matches (2 , "a." , locals_ = {"a" : Foo ()}),
257- set ([ "a.method" , "a.a" , "a.b" ]) ,
257+ { "a.method" , "a.a" , "a.b" } ,
258258 )
259259
260260 def test_descriptor_attributes_not_run (self ):
261261 com = autocomplete .AttrCompletion ()
262262 self .assertSetEqual (
263263 com .matches (2 , "a." , locals_ = {"a" : Properties ()}),
264- set ([ "a.b" , "a.a" , "a.method" , "a.asserts_when_called" ]) ,
264+ { "a.b" , "a.a" , "a.method" , "a.asserts_when_called" } ,
265265 )
266266
267267 def test_custom_get_attribute_not_invoked (self ):
268268 com = autocomplete .AttrCompletion ()
269269 self .assertSetEqual (
270270 com .matches (2 , "a." , locals_ = {"a" : OverriddenGetattribute ()}),
271- set ([ "a.b" , "a.a" , "a.method" ]) ,
271+ { "a.b" , "a.a" , "a.method" } ,
272272 )
273273
274274 def test_slots_not_crash (self ):
275275 com = autocomplete .AttrCompletion ()
276276 self .assertSetEqual (
277- com .matches (2 , "A." , locals_ = {"A" : Slots }), set ([ "A.b" , "A.a" ]) ,
277+ com .matches (2 , "A." , locals_ = {"A" : Slots }), { "A.b" , "A.a" } ,
278278 )
279279
280280
@@ -286,7 +286,7 @@ def setUpClass(cls):
286286 def test_att_matches_found_on_instance (self ):
287287 self .assertSetEqual (
288288 self .com .matches (5 , "a[0]." , locals_ = {"a" : [Foo ()]}),
289- set ([ "method" , "a" , "b" ]) ,
289+ { "method" , "a" , "b" } ,
290290 )
291291
292292 def test_other_getitem_methods_not_called (self ):
@@ -299,7 +299,7 @@ def __getitem__(inner_self, i):
299299 def test_tuples_complete (self ):
300300 self .assertSetEqual (
301301 self .com .matches (5 , "a[0]." , locals_ = {"a" : (Foo (),)}),
302- set ([ "method" , "a" , "b" ]) ,
302+ { "method" , "a" , "b" } ,
303303 )
304304
305305 @unittest .skip ("TODO, subclasses do not complete yet" )
@@ -309,7 +309,7 @@ class ListSubclass(list):
309309
310310 self .assertSetEqual (
311311 self .com .matches (5 , "a[0]." , locals_ = {"a" : ListSubclass ([Foo ()])}),
312- set ([ "method" , "a" , "b" ]) ,
312+ { "method" , "a" , "b" } ,
313313 )
314314
315315 def test_getitem_not_called_in_list_subclasses_overriding_getitem (self ):
@@ -322,13 +322,13 @@ def __getitem__(inner_self, i):
322322 def test_literals_complete (self ):
323323 self .assertSetEqual (
324324 self .com .matches (10 , "[a][0][0]." , locals_ = {"a" : (Foo (),)}),
325- set ([ "method" , "a" , "b" ]) ,
325+ { "method" , "a" , "b" } ,
326326 )
327327
328328 def test_dictionaries_complete (self ):
329329 self .assertSetEqual (
330330 self .com .matches (7 , 'a["b"].' , locals_ = {"a" : {"b" : Foo ()}}),
331- set ([ "method" , "a" , "b" ]) ,
331+ { "method" , "a" , "b" } ,
332332 )
333333
334334
@@ -391,7 +391,7 @@ def test_completions_starting_with_different_cases(self):
391391 ["adsf" ],
392392 [Comp ("Abc" , "bc" ), Comp ("ade" , "de" )],
393393 )
394- self .assertSetEqual (matches , set ([ "ade" ]) )
394+ self .assertSetEqual (matches , { "ade" } )
395395
396396 def test_issue_544 (self ):
397397 com = autocomplete .MultilineJediCompletion ()
@@ -410,12 +410,12 @@ def function():
410410
411411 self .assertEqual (
412412 self .com .matches (8 , "function" , locals_ = {"function" : function }),
413- set (( "function(" ,)) ,
413+ { "function(" } ,
414414 )
415415
416416 def test_completions_are_unicode (self ):
417417 for m in self .com .matches (1 , "a" , locals_ = {"abc" : 10 }):
418- self .assertIsInstance (m , type (u "" ))
418+ self .assertIsInstance (m , type ("" ))
419419
420420 def test_mock_kwlist (self ):
421421 with mock .patch .object (keyword , "kwlist" , new = ["abcd" ]):
@@ -435,11 +435,11 @@ def func(apple, apricot, banana, carrot):
435435 argspec = ["func" , argspec , False ]
436436 com = autocomplete .ParameterNameCompletion ()
437437 self .assertSetEqual (
438- com .matches (1 , "a" , argspec = argspec ), set ([ "apple=" , "apricot=" ])
438+ com .matches (1 , "a" , argspec = argspec ), { "apple=" , "apricot=" }
439439 )
440440 self .assertSetEqual (
441- com .matches (2 , "ba" , argspec = argspec ), set ([ "banana=" ])
441+ com .matches (2 , "ba" , argspec = argspec ), { "banana=" }
442442 )
443443 self .assertSetEqual (
444- com .matches (3 , "car" , argspec = argspec ), set ([ "carrot=" ])
444+ com .matches (3 , "car" , argspec = argspec ), { "carrot=" }
445445 )
0 commit comments