forked from VimPlug/jedi
Fix namedtuples and reactivate tests for Python 2
This commit is contained in:
@@ -32,7 +32,8 @@ from jedi.evaluate.syntax_tree import is_string
|
|||||||
|
|
||||||
# Copied from Python 3.6's stdlib.
|
# Copied from Python 3.6's stdlib.
|
||||||
_NAMEDTUPLE_CLASS_TEMPLATE = """\
|
_NAMEDTUPLE_CLASS_TEMPLATE = """\
|
||||||
from builtins import property as _property, tuple as _tuple
|
_property = property
|
||||||
|
_tuple = tuple
|
||||||
from operator import itemgetter as _itemgetter
|
from operator import itemgetter as _itemgetter
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
|
||||||
|
|||||||
@@ -7,14 +7,6 @@ from textwrap import dedent
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
# The namedtuple is different for different Python2.7 versions. Some versions
|
|
||||||
# are missing the attribute `_class_template`.
|
|
||||||
@pytest.fixture(autouse=True)
|
|
||||||
def skipping(environment):
|
|
||||||
if environment.version_info.major < 3:
|
|
||||||
pytest.skip()
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(['letter', 'expected'], [
|
@pytest.mark.parametrize(['letter', 'expected'], [
|
||||||
('n', ['name']),
|
('n', ['name']),
|
||||||
('s', ['smart']),
|
('s', ['smart']),
|
||||||
|
|||||||
Reference in New Issue
Block a user