forked from VimPlug/jedi
Use set literals
This commit is contained in:
@@ -103,7 +103,7 @@ def test_completion_on_complex_literals():
|
||||
_check_number('4.0j.', 'complex')
|
||||
# No dot no completion - I thought, but 4j is actually a literall after
|
||||
# which a keyword like or is allowed. Good times, haha!
|
||||
assert (set([c.name for c in api.Script('4j').completions()]) ==
|
||||
assert ({c.name for c in api.Script('4j').completions()} ==
|
||||
{'if', 'and', 'in', 'is', 'not', 'or'})
|
||||
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ def test_basedefinition_type(definition):
|
||||
|
||||
def test_basedefinition_type_import():
|
||||
def get_types(source, **kwargs):
|
||||
return set([t.type for t in Script(source, **kwargs).completions()])
|
||||
return {t.type for t in Script(source, **kwargs).completions()}
|
||||
|
||||
# import one level
|
||||
assert get_types('import t') == {'module'}
|
||||
|
||||
@@ -261,7 +261,7 @@ def test_completion_param_annotations():
|
||||
a, b, c = c.params
|
||||
assert a._goto_definitions() == []
|
||||
assert [d.name for d in b._goto_definitions()] == ['str']
|
||||
assert set([d.name for d in c._goto_definitions()]) == {'int', 'float'}
|
||||
assert {d.name for d in c._goto_definitions()} == {'int', 'float'}
|
||||
|
||||
|
||||
def test_more_complex_instances():
|
||||
|
||||
Reference in New Issue
Block a user