diff --git a/test/completion/imports.py b/test/completion/imports.py index c1653e05..4ff87c4d 100644 --- a/test/completion/imports.py +++ b/test/completion/imports.py @@ -167,11 +167,11 @@ from .......import_tree import mod1 #? mod1.a -from .. import base +from .. import helpers #? int() -base.sample_int +helpers.sample_int -from ..base import sample_int as f +from ..helpers import sample_int as f #? int() f diff --git a/test/conftest.py b/test/conftest.py index f5f992da..df0ecd1d 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -4,7 +4,7 @@ import tempfile import pytest -from . import base +from . import helpers from . import run from . import refactor @@ -12,11 +12,11 @@ from . import refactor def pytest_addoption(parser): parser.addoption( "--integration-case-dir", - default=os.path.join(base.test_dir, 'completion'), + default=os.path.join(helpers.test_dir, 'completion'), help="Directory in which integration test case files locate.") parser.addoption( "--refactor-case-dir", - default=os.path.join(base.test_dir, 'refactor'), + default=os.path.join(helpers.test_dir, 'refactor'), help="Directory in which refactoring test case files locate.") parser.addoption( "--test-files", "-T", default=[], action='append', diff --git a/test/base.py b/test/helpers.py similarity index 100% rename from test/base.py rename to test/helpers.py diff --git a/test/test_absolute_import.py b/test/test_absolute_import.py index 1fe9aa9d..2128c70b 100644 --- a/test/test_absolute_import.py +++ b/test/test_absolute_import.py @@ -1,6 +1,10 @@ +""" +Tests ``from __future__ import absolute_import`` (only important for +Python 2.X) +""" import jedi from jedi.parsing import Parser -from . import base +from . import helpers def test_explicit_absolute_imports(): @@ -29,7 +33,7 @@ def test_dont_break_imports_without_namespaces(): assert parser.module.has_explicit_absolute_import -@base.cwd_at("test/absolute_import") +@helpers.cwd_at("test/absolute_import") def test_can_complete_when_shadowing(): filename = "unittest.py" with open(filename) as f: diff --git a/test/test_call_signatures.py b/test/test_call_signatures.py index 6345bad9..f6914bbb 100644 --- a/test/test_call_signatures.py +++ b/test/test_call_signatures.py @@ -1,9 +1,9 @@ import textwrap -from .base import unittest +from .helpers import TestCase from jedi import Script -class TestCallSignatures(unittest.TestCase): +class TestCallSignatures(TestCase): def _run(self, source, expected_name, expected_index=0, line=None, column=None): signatures = Script(source, line, column).call_signatures() diff --git a/test/test_defined_names.py b/test/test_defined_names.py index decf8659..bb7da814 100644 --- a/test/test_defined_names.py +++ b/test/test_defined_names.py @@ -5,11 +5,10 @@ Tests for `api.defined_names`. import textwrap from jedi import api -from .base import TestCase +from .helpers import TestCase class TestDefinedNames(TestCase): - def assert_definition_names(self, definitions, names): self.assertEqual([d.name for d in definitions], names) diff --git a/test/test_docstring.py b/test/test_docstring.py index 7e687fcc..8a8f4c3d 100644 --- a/test/test_docstring.py +++ b/test/test_docstring.py @@ -3,7 +3,7 @@ Testing of docstring related issues and especially ``jedi.docstrings``. """ import jedi -from .base import unittest +from .helpers import unittest class TestDocstring(unittest.TestCase): diff --git a/test/test_full_name.py b/test/test_full_name.py index ebce02b5..5378a97a 100644 --- a/test/test_full_name.py +++ b/test/test_full_name.py @@ -17,7 +17,7 @@ import textwrap import jedi from jedi import api_classes -from .base import unittest +from .helpers import TestCase class MixinTestFullName(object): @@ -38,7 +38,7 @@ class MixinTestFullName(object): self.check('from os import path', 'os.path') -class TestFullNameWithGotoDefinitions(MixinTestFullName, unittest.TestCase): +class TestFullNameWithGotoDefinitions(MixinTestFullName, TestCase): operation = 'goto_definitions' def test_tuple_mapping(self): @@ -48,11 +48,11 @@ class TestFullNameWithGotoDefinitions(MixinTestFullName, unittest.TestCase): any_re""", 're.RegexObject') -class TestFullNameWithCompletions(MixinTestFullName, unittest.TestCase): +class TestFullNameWithCompletions(MixinTestFullName, TestCase): operation = 'completions' -class TestFullDefinedName(unittest.TestCase): +class TestFullDefinedName(TestCase): """ Test combination of ``obj.full_name`` and ``jedi.defined_names``. """ diff --git a/test/test_integration.py b/test/test_integration.py index 6c6901d0..f80c4009 100644 --- a/test/test_integration.py +++ b/test/test_integration.py @@ -2,7 +2,7 @@ import os import pytest -from . import base +from . import helpers def assert_case_equal(case, actual, desired): @@ -23,7 +23,7 @@ desired = %s def test_integration(case, monkeypatch, pytestconfig): if case.skip is not None: pytest.skip(case.skip) - repo_root = base.root_dir + repo_root = helpers.root_dir monkeypatch.chdir(os.path.join(repo_root, 'jedi')) case.run(assert_case_equal) diff --git a/test/test_integration_import.py b/test/test_integration_import.py index 139b870f..9ea43e69 100644 --- a/test/test_integration_import.py +++ b/test/test_integration_import.py @@ -6,7 +6,7 @@ Tests". import itertools from jedi import Script -from .base import cwd_at +from .helpers import cwd_at def test_goto_definition_on_import(): diff --git a/test/test_interpreter.py b/test/test_interpreter.py index c7240baa..ffeba666 100644 --- a/test/test_interpreter.py +++ b/test/test_interpreter.py @@ -2,7 +2,7 @@ Tests of ``jedi.api.Interpreter``. """ -from .base import TestCase +from .helpers import TestCase import jedi from jedi._compatibility import is_py33 diff --git a/test/test_regression.py b/test/test_regression.py index a43019be..3d01dfdb 100644 --- a/test/test_regression.py +++ b/test/test_regression.py @@ -8,7 +8,7 @@ found a good place in any other testing module. import os import textwrap -from .base import TestCase, cwd_at +from .helpers import TestCase, cwd_at import jedi from jedi import Script diff --git a/test/test_speed.py b/test/test_speed.py index ce69adfd..78fb10ad 100644 --- a/test/test_speed.py +++ b/test/test_speed.py @@ -6,7 +6,7 @@ should. import time import functools -from .base import TestCase +from .helpers import TestCase import jedi class TestSpeed(TestCase):