From 656324f686a9d4d4f972f2d41dfcb52296da4d7c Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sun, 1 Mar 2020 13:30:41 +0100 Subject: [PATCH] Disable some more tests for Python 2 --- jedi/inference/gradual/typing.py | 4 +++- test/test_integration.py | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/jedi/inference/gradual/typing.py b/jedi/inference/gradual/typing.py index e45e4f98..85a34396 100644 --- a/jedi/inference/gradual/typing.py +++ b/jedi/inference/gradual/typing.py @@ -6,6 +6,8 @@ values. This file deals with all the typing.py cases. """ import itertools + +from jedi._compatibility import unicode from jedi import debug from jedi.inference.compiled import builtin_from_name, create_simple_object from jedi.inference.base_value import ValueSet, NO_VALUES, Value, \ @@ -363,7 +365,7 @@ class TypedDict(LazyValueWrapper): return ValueName(self, self.tree_node.name) def py__simple_getitem__(self, index): - if isinstance(index, str): + if isinstance(index, unicode): return ValueSet.from_sets( name.infer() for filter in self._definition_class.get_filters(is_instance=True) diff --git a/test/test_integration.py b/test/test_integration.py index 64239048..be447773 100644 --- a/test/test_integration.py +++ b/test/test_integration.py @@ -1,4 +1,5 @@ import os +import sys import pytest @@ -36,6 +37,9 @@ def test_completion(case, monkeypatch, environment, has_typing): if skip_reason is not None: pytest.skip(skip_reason) + if 'pep0484_typing' in case.path and sys.version_info[0] == 2: + pytest.skip('ditch python 2 finally') + _CONTAINS_TYPING = ('pep0484_typing', 'pep0484_comments', 'pep0526_variables') if not has_typing and any(x in case.path for x in _CONTAINS_TYPING): pytest.skip('Needs the typing module installed to run this test.')