From ae1f5fa5110fe8fd0e948a2866489af23afece3d Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sun, 9 Dec 2018 12:41:58 +0100 Subject: [PATCH] Fix namedtuples and reactivate tests for Python 2 --- jedi/plugins/stdlib.py | 3 ++- test/test_evaluate/test_stdlib.py | 8 -------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/jedi/plugins/stdlib.py b/jedi/plugins/stdlib.py index 88a938b3..3319046a 100644 --- a/jedi/plugins/stdlib.py +++ b/jedi/plugins/stdlib.py @@ -32,7 +32,8 @@ from jedi.evaluate.syntax_tree import is_string # Copied from Python 3.6's stdlib. _NAMEDTUPLE_CLASS_TEMPLATE = """\ -from builtins import property as _property, tuple as _tuple +_property = property +_tuple = tuple from operator import itemgetter as _itemgetter from collections import OrderedDict diff --git a/test/test_evaluate/test_stdlib.py b/test/test_evaluate/test_stdlib.py index d3f0e620..b340eb2b 100644 --- a/test/test_evaluate/test_stdlib.py +++ b/test/test_evaluate/test_stdlib.py @@ -7,14 +7,6 @@ from textwrap import dedent 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'], [ ('n', ['name']), ('s', ['smart']),