mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
Use set literals
This commit is contained in:
@@ -56,7 +56,7 @@ class TestSetupReadline(unittest.TestCase):
|
||||
string = 'os.path.join("a").upper'
|
||||
assert self.completions(string) == [string]
|
||||
|
||||
c = set(['os.' + d for d in dir(os) if d.startswith('ch')])
|
||||
c = {'os.' + d for d in dir(os) if d.startswith('ch')}
|
||||
assert set(self.completions('os.ch')) == set(c)
|
||||
finally:
|
||||
del self.namespace.sys
|
||||
@@ -73,7 +73,7 @@ class TestSetupReadline(unittest.TestCase):
|
||||
|
||||
import os
|
||||
s = 'from os import '
|
||||
goal = set([s + el for el in dir(os)])
|
||||
goal = {s + el for el in dir(os)}
|
||||
# There are minor differences, e.g. the dir doesn't include deleted
|
||||
# items as well as items that are not only available on linux.
|
||||
assert len(set(self.completions(s)).symmetric_difference(goal)) < 20
|
||||
@@ -85,7 +85,7 @@ class TestSetupReadline(unittest.TestCase):
|
||||
|
||||
def test_preexisting_values(self):
|
||||
self.namespace.a = range(10)
|
||||
assert set(self.completions('a.')) == set(['a.' + n for n in dir(range(1))])
|
||||
assert set(self.completions('a.')) == {'a.' + n for n in dir(range(1))}
|
||||
del self.namespace.a
|
||||
|
||||
def test_colorama(self):
|
||||
|
||||
Reference in New Issue
Block a user