py.test should be able to call the tests from different directories: fix pyc tests

This commit is contained in:
Dave Halter
2014-03-17 08:48:48 +01:00
parent 5e6616a451
commit 4c6c9c4fb5

View File

@@ -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")