mirror of
https://github.com/davidhalter/jedi.git
synced 2026-01-20 19:02:50 +08:00
move some tests into specific directories
This commit is contained in:
0
test/parser/__init__.py
Normal file
0
test/parser/__init__.py
Normal file
37
test/parser/test_fast_parser.py
Normal file
37
test/parser/test_fast_parser.py
Normal file
@@ -0,0 +1,37 @@
|
||||
import jedi
|
||||
|
||||
def test_add_to_end():
|
||||
"""
|
||||
fast_parser doesn't parse everything again. It just updates with the
|
||||
help of caches, this is an example that didn't work.
|
||||
"""
|
||||
|
||||
a = """
|
||||
class Abc():
|
||||
def abc(self):
|
||||
self.x = 3
|
||||
|
||||
class Two(Abc):
|
||||
def h(self):
|
||||
self
|
||||
""" # ^ here is the first completion
|
||||
|
||||
b = " def g(self):\n" \
|
||||
" self."
|
||||
assert jedi.Script(a, 8, 12, 'example.py').completions()
|
||||
assert jedi.Script(a + b, path='example.py').completions()
|
||||
|
||||
a = a[:-1] + '.\n'
|
||||
assert jedi.Script(a, 8, 13, 'example.py').completions()
|
||||
assert jedi.Script(a + b, path='example.py').completions()
|
||||
|
||||
|
||||
def test_class_in_docstr():
|
||||
"""
|
||||
Regression test for a problem with classes in docstrings.
|
||||
"""
|
||||
a = '"\nclasses\n"'
|
||||
jedi.Script(a, 1, 0)._parser
|
||||
|
||||
b = a + '\nimport os'
|
||||
assert jedi.Script(b, 4, 8).goto_assignments()
|
||||
Reference in New Issue
Block a user