mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-09 07:14:48 +08:00
py.test should be able to call the tests from different directories: fix pyc tests
This commit is contained in:
@@ -12,6 +12,7 @@ import shutil
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
import jedi
|
import jedi
|
||||||
|
from .helpers import cwd_at
|
||||||
|
|
||||||
|
|
||||||
SRC = """class Foo:
|
SRC = """class Foo:
|
||||||
@@ -42,13 +43,14 @@ def generate_pyc():
|
|||||||
shutil.copy(os.path.join("dummy_package/__pycache__", f), dst)
|
shutil.copy(os.path.join("dummy_package/__pycache__", f), dst)
|
||||||
|
|
||||||
|
|
||||||
|
@cwd_at('test')
|
||||||
def test_pyc():
|
def test_pyc():
|
||||||
"""
|
"""
|
||||||
The list of completion must be greater than 2.
|
The list of completion must be greater than 2.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
generate_pyc()
|
generate_pyc()
|
||||||
s = jedi.Script("from dummy_package import dummy; dummy.")
|
s = jedi.Script("from dummy_package import dummy; dummy.", path='blub.py')
|
||||||
assert len(s.completions()) >= 2
|
assert len(s.completions()) >= 2
|
||||||
finally:
|
finally:
|
||||||
shutil.rmtree("dummy_package")
|
shutil.rmtree("dummy_package")
|
||||||
|
|||||||
Reference in New Issue
Block a user