mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 06:44:46 +08:00
Define the operations in the class, not in the function
I was originally going to try to automatically include these in the docstring using format, but they would have to be defined before the docstring for that to work. But I think it's still useful to have these defined in the class.
This commit is contained in:
9
sith.py
9
sith.py
@@ -87,12 +87,13 @@ class TestCase(object):
|
|||||||
dct = json.load(f)
|
dct = json.load(f)
|
||||||
return cls(**dct)
|
return cls(**dct)
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
'completions', 'goto_assignments', 'goto_definitions', 'usages',
|
||||||
|
'call_signatures']
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def generate(cls, file_path):
|
def generate(cls, file_path):
|
||||||
operations = [
|
operation = random.choice(cls.operations)
|
||||||
'completions', 'goto_assignments', 'goto_definitions', 'usages',
|
|
||||||
'call_signatures']
|
|
||||||
operation = random.choice(operations)
|
|
||||||
|
|
||||||
path = random.choice(SourceFinder.files(file_path))
|
path = random.choice(SourceFinder.files(file_path))
|
||||||
with open(path) as f:
|
with open(path) as f:
|
||||||
|
|||||||
Reference in New Issue
Block a user