moved extension tests into test_evaluate folder

This commit is contained in:
Dave Halter
2014-03-11 12:37:02 +01:00
parent cd7774f25f
commit 2457da0e7d
8 changed files with 3 additions and 3 deletions

View File

@@ -0,0 +1,10 @@
This directory contains pre-compiled extensions modules used to test completions
for compiled modules on Travis-CI (Ubuntu 12.04 64bit).
To build the extensions modules, run::
python setup.py build_ext -i
Then move the compiled modules to their testing package ( ./**compiledXX**, where XX is the
python version used to run setup.py).

View File

@@ -0,0 +1,6 @@
cdef class Foo:
pass
cdef class Bar:
pass

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,6 @@
from distutils.core import setup
from Cython.Build import cythonize
setup(
ext_modules=cythonize("compiled.pyx")
)

View File

@@ -0,0 +1,42 @@
"""
Test compiled module
"""
import os
import platform
import sys
import jedi
from ..helpers import cwd_at
@cwd_at('test/test_evaluate/extensions')
def test_completions():
if platform.architecture()[0] == '64bit':
package_name = "compiled%s%s" % sys.version_info[:2]
sys.path.insert(0, os.getcwd())
if os.path.exists(package_name):
s = jedi.Script("from %s import compiled; compiled." % package_name)
assert len(s.completions()) >= 2
@cwd_at('test/test_evaluate/extensions')
def test_call_signatures_extension():
# with a cython extension
if platform.architecture()[0] == '64bit':
package_name = "compiled%s%s" % sys.version_info[:2]
sys.path.insert(0, os.getcwd())
if os.path.exists(package_name):
s = jedi.Script("from %s import compiled; compiled.Foo(" %
package_name)
defs = s.call_signatures()
for call_def in defs:
for param in call_def.params:
pass
def test_call_signatures_stdlib():
code = "import math; math.cos("
s = jedi.Script(code)
defs = s.call_signatures()
for call_def in defs:
assert len(call_def.params) == 1