mirror of
https://github.com/davidhalter/jedi.git
synced 2026-02-25 05:47:12 +08:00
Fix the compatibility docstring
This commit is contained in:
@@ -3,15 +3,8 @@ A helper module for testing, improves compatibility for testing (as
|
||||
``jedi._compatibility``) as well as introducing helper functions.
|
||||
"""
|
||||
|
||||
import sys
|
||||
from contextlib import contextmanager
|
||||
|
||||
if sys.hexversion < 0x02070000:
|
||||
import unittest2 as unittest
|
||||
else:
|
||||
import unittest
|
||||
TestCase = unittest.TestCase
|
||||
|
||||
import os
|
||||
import pytest
|
||||
from os.path import abspath, dirname, join
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import sys
|
||||
from textwrap import dedent
|
||||
import inspect
|
||||
from unittest import TestCase
|
||||
|
||||
import pytest
|
||||
|
||||
from ..helpers import TestCase
|
||||
from jedi import cache
|
||||
from jedi.parser_utils import get_signature
|
||||
from jedi import Interpreter
|
||||
|
||||
@@ -14,11 +14,11 @@ There are three kinds of test:
|
||||
"""
|
||||
|
||||
import textwrap
|
||||
from unittest import TestCase
|
||||
|
||||
import pytest
|
||||
|
||||
import jedi
|
||||
from ..helpers import TestCase
|
||||
|
||||
|
||||
class MixinTestFullName(object):
|
||||
|
||||
@@ -2,26 +2,25 @@
|
||||
"""
|
||||
All character set and unicode related tests.
|
||||
"""
|
||||
from jedi._compatibility import u, unicode
|
||||
from jedi._compatibility import u
|
||||
from jedi import Project
|
||||
|
||||
|
||||
def test_unicode_script(Script):
|
||||
""" normally no unicode objects are being used. (<=2.7) """
|
||||
s = unicode("import datetime; datetime.timedelta")
|
||||
s = "import datetime; datetime.timedelta"
|
||||
completions = Script(s).complete()
|
||||
assert len(completions)
|
||||
assert type(completions[0].description) is unicode
|
||||
assert type(completions[0].description) is str
|
||||
|
||||
s = u("author='öä'; author")
|
||||
completions = Script(s).complete()
|
||||
x = completions[0].description
|
||||
assert type(x) is unicode
|
||||
assert type(x) is str
|
||||
|
||||
s = u("#-*- coding: iso-8859-1 -*-\nauthor='öä'; author")
|
||||
s = s.encode('latin-1')
|
||||
completions = Script(s).complete()
|
||||
assert type(completions[0].description) is unicode
|
||||
assert type(completions[0].description) is str
|
||||
|
||||
|
||||
def test_unicode_attribute(Script):
|
||||
|
||||
@@ -87,9 +87,6 @@ def test_tokenizer_with_string_literal_backslash(Script):
|
||||
|
||||
|
||||
def test_ellipsis_without_getitem(Script, environment):
|
||||
if environment.version_info.major == 2:
|
||||
pytest.skip('In 2.7 Ellipsis can only be used like x[...]')
|
||||
|
||||
def_, = Script('x=...;x').infer()
|
||||
|
||||
assert def_.name == 'ellipsis'
|
||||
|
||||
@@ -2,11 +2,10 @@ try:
|
||||
import readline
|
||||
except ImportError:
|
||||
readline = False
|
||||
import unittest
|
||||
|
||||
from jedi import utils
|
||||
|
||||
from .helpers import unittest
|
||||
|
||||
|
||||
@unittest.skipIf(not readline, "readline not found")
|
||||
class TestSetupReadline(unittest.TestCase):
|
||||
|
||||
Reference in New Issue
Block a user