finally change name of test.base module to helpers.py, fixes #181

This commit is contained in:
David Halter
2013-08-07 18:35:47 +04:30
parent 45432c6cb0
commit 7ab00242a8
13 changed files with 26 additions and 23 deletions

View File

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

View File

@@ -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',

View File

@@ -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:

View File

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

View File

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

View File

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

View File

@@ -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``.
"""

View File

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

View File

@@ -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():

View File

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

View File

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

View File

@@ -6,7 +6,7 @@ should.
import time
import functools
from .base import TestCase
from .helpers import TestCase
import jedi
class TestSpeed(TestCase):