diff --git a/test/api/__init__.py b/test/api/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/test/test_api.py b/test/api/test_api.py similarity index 100% rename from test/test_api.py rename to test/api/test_api.py diff --git a/test/test_api_classes.py b/test/api/test_api_classes.py similarity index 100% rename from test/test_api_classes.py rename to test/api/test_api_classes.py diff --git a/test/test_call_signatures.py b/test/api/test_call_signatures.py similarity index 99% rename from test/test_call_signatures.py rename to test/api/test_call_signatures.py index e8f42538..d881c11f 100644 --- a/test/test_call_signatures.py +++ b/test/api/test_call_signatures.py @@ -1,6 +1,6 @@ import textwrap -from .helpers import TestCase +from ..helpers import TestCase from jedi import Script diff --git a/test/test_defined_names.py b/test/api/test_defined_names.py similarity index 98% rename from test/test_defined_names.py rename to test/api/test_defined_names.py index bb7da814..c3b665a7 100644 --- a/test/test_defined_names.py +++ b/test/api/test_defined_names.py @@ -5,7 +5,7 @@ Tests for `api.defined_names`. import textwrap from jedi import api -from .helpers import TestCase +from ..helpers import TestCase class TestDefinedNames(TestCase): diff --git a/test/test_full_name.py b/test/api/test_full_name.py similarity index 98% rename from test/test_full_name.py rename to test/api/test_full_name.py index 06a5c39a..259c13d1 100644 --- a/test/test_full_name.py +++ b/test/api/test_full_name.py @@ -18,7 +18,7 @@ import textwrap import jedi from jedi.api import classes from jedi.evaluate import Evaluator -from .helpers import TestCase +from ..helpers import TestCase class MixinTestFullName(object): diff --git a/test/test_interpreter.py b/test/api/test_interpreter.py similarity index 98% rename from test/test_interpreter.py rename to test/api/test_interpreter.py index ea871b06..6a15c4ab 100644 --- a/test/test_interpreter.py +++ b/test/api/test_interpreter.py @@ -2,7 +2,7 @@ Tests of ``jedi.api.Interpreter``. """ -from .helpers import TestCase +from ..helpers import TestCase import jedi from jedi._compatibility import is_py33 diff --git a/test/test_unicode.py b/test/api/test_unicode.py similarity index 99% rename from test/test_unicode.py rename to test/api/test_unicode.py index c9c10648..895be6bd 100644 --- a/test/test_unicode.py +++ b/test/api/test_unicode.py @@ -5,6 +5,7 @@ All character set and unicode related tests. from jedi import Script from jedi._compatibility import utf8, unicode + def test_unicode_script(): """ normally no unicode objects are being used. (<=2.7) """ s = unicode("import datetime; datetime.timedelta") @@ -22,6 +23,7 @@ def test_unicode_script(): completions = Script(s).completions() assert type(completions[0].description) is unicode + def test_unicode_attribute(): """ github jedi-vim issue #94 """ s1 = utf8('#-*- coding: utf-8 -*-\nclass Person():\n' @@ -33,6 +35,7 @@ def test_unicode_attribute(): completions2 = Script(s2).completions() assert 'strip' in [c.name for c in completions2] + def test_multibyte_script(): """ `jedi.Script` must accept multi-byte string source. """ try: @@ -43,4 +46,3 @@ def test_multibyte_script(): pass # python 3 has no unicode method else: assert len(Script(s, 1, len(code)).completions()) - diff --git a/test/evaluate/__init__.py b/test/evaluate/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/test/test_absolute_import.py b/test/evaluate/test_absolute_import.py similarity index 98% rename from test/test_absolute_import.py rename to test/evaluate/test_absolute_import.py index 3c3aa61e..e4caa2ee 100644 --- a/test/test_absolute_import.py +++ b/test/evaluate/test_absolute_import.py @@ -4,7 +4,7 @@ Python 2.X) """ import jedi from jedi.parser import Parser -from . import helpers +from .. import helpers def test_explicit_absolute_imports(): diff --git a/test/test_compiled.py b/test/evaluate/test_compiled.py similarity index 100% rename from test/test_compiled.py rename to test/evaluate/test_compiled.py diff --git a/test/test_docstring.py b/test/evaluate/test_docstring.py similarity index 98% rename from test/test_docstring.py rename to test/evaluate/test_docstring.py index 8a8f4c3d..7ec0f596 100644 --- a/test/test_docstring.py +++ b/test/evaluate/test_docstring.py @@ -3,7 +3,7 @@ Testing of docstring related issues and especially ``jedi.docstrings``. """ import jedi -from .helpers import unittest +from ..helpers import unittest class TestDocstring(unittest.TestCase): diff --git a/test/test_imports.py b/test/evaluate/test_imports.py similarity index 96% rename from test/test_imports.py rename to test/evaluate/test_imports.py index ef62b18f..1b5c5832 100644 --- a/test/test_imports.py +++ b/test/evaluate/test_imports.py @@ -2,7 +2,7 @@ import pytest import jedi from jedi._compatibility import find_module_py33 -from .helpers import cwd_at +from ..helpers import cwd_at @pytest.mark.skipif('sys.version_info < (3,3)') diff --git a/test/parser/__init__.py b/test/parser/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/test/test_fast_parser.py b/test/parser/test_fast_parser.py similarity index 100% rename from test/test_fast_parser.py rename to test/parser/test_fast_parser.py diff --git a/test/test_namespace_package.py b/test/test_namespace_package.py index 67c6bc51..f39f58ef 100644 --- a/test/test_namespace_package.py +++ b/test/test_namespace_package.py @@ -2,6 +2,7 @@ import jedi import sys from os.path import dirname, join + def test_namespace_package(): sys.path.insert(0, join(dirname(__file__), 'namespace_package/ns1')) sys.path.insert(1, join(dirname(__file__), 'namespace_package/ns2')) @@ -47,7 +48,6 @@ def test_namespace_package(): solution = "statement: foo = '%s'" % solution assert completion.description == solution - finally: sys.path.pop(0) sys.path.pop(0)