diff --git a/jedi/evaluate/helpers.py b/jedi/evaluate/helpers.py index 122d05c6..264b7815 100644 --- a/jedi/evaluate/helpers.py +++ b/jedi/evaluate/helpers.py @@ -219,6 +219,7 @@ def get_int_or_none(context): def get_str_or_none(context): return _get_safe_value_or_none(context, (bytes, unicode)) + def is_number(context): return _get_safe_value_or_none(context, (int, float)) is not None diff --git a/test/test_api/test_interpreter.py b/test/test_api/test_interpreter.py index 7b150a34..cb44bb9c 100644 --- a/test/test_api/test_interpreter.py +++ b/test/test_api/test_interpreter.py @@ -1,6 +1,8 @@ """ Tests of ``jedi.api.Interpreter``. """ +import sys + import pytest import jedi @@ -378,6 +380,7 @@ def test_sys_path_docstring(): # Was an issue in #1298 s.completions()[0].docstring() +@pytest.mark.skipif(sys.version_info[0] == 2, reason="Ignore Python 2, because EOL") @pytest.mark.parametrize( 'code, completions', [ ('x[0].uppe', ['upper']),