1
0
forked from VimPlug/jedi

Drop redundant conditional skips for unsupported Python versions

This commit is contained in:
Peter Law
2023-09-17 18:38:12 +01:00
parent 9d399a9229
commit 7e533ca7e1
4 changed files with 5 additions and 25 deletions

View File

@@ -188,10 +188,7 @@ def test_functions_should_have_params(Script):
assert c.get_signatures()
def test_hashlib_params(Script, environment):
if environment.version_info < (3,):
pytest.skip()
def test_hashlib_params(Script):
script = Script('from hashlib import sha256')
c, = script.complete()
sig, = c.get_signatures()

View File

@@ -1,13 +1,6 @@
import pytest
from textwrap import dedent
@pytest.fixture(autouse=True)
def skip_not_supported(environment):
if environment.version_info < (3, 6):
pytest.skip()
def test_fstring_multiline(Script):
code = dedent("""\
'' f'''s{

View File

@@ -12,29 +12,23 @@ def _infer_literal(Script, code, is_fstring=False):
return def_._name._value.get_safe_value()
def test_f_strings(Script, environment):
def test_f_strings(Script):
"""
f literals are not really supported in Jedi. They just get ignored and an
empty string is returned.
"""
if environment.version_info < (3, 6):
pytest.skip()
assert _infer_literal(Script, 'f"asdf"', is_fstring=True) == ''
assert _infer_literal(Script, 'f"{asdf} "', is_fstring=True) == ''
assert _infer_literal(Script, 'F"{asdf} "', is_fstring=True) == ''
assert _infer_literal(Script, 'rF"{asdf} "', is_fstring=True) == ''
def test_rb_strings(Script, environment):
def test_rb_strings(Script):
assert _infer_literal(Script, 'x = br"asdf"; x') == b'asdf'
assert _infer_literal(Script, 'x = rb"asdf"; x') == b'asdf'
def test_thousand_separators(Script, environment):
if environment.version_info < (3, 6):
pytest.skip()
def test_thousand_separators(Script):
assert _infer_literal(Script, '1_2_3') == 123
assert _infer_literal(Script, '123_456_789') == 123456789
assert _infer_literal(Script, '0x3_4') == 52

View File

@@ -1,5 +1,5 @@
from textwrap import dedent
from operator import ge, lt
from operator import ge
import re
import os
@@ -17,14 +17,10 @@ from ..helpers import get_example_dir
('str', "str(object='', /) -> str", ['object'], ge, (3, 6)),
('pow', 'pow(x, y, z=None, /) -> number', ['x', 'y', 'z'], lt, (3, 6)),
('pow', 'pow(base, exp, mod=None)', ['base', 'exp', 'mod'], ge, (3, 8)),
('bytes.partition', 'partition(self, sep, /) -> (head, sep, tail)',
['self', 'sep'], lt, (3, 6)),
('bytes.partition', 'partition(self, sep, /)', ['self', 'sep'], ge, (3, 6)),
('bytes().partition', 'partition(sep, /) -> (head, sep, tail)', ['sep'], lt, (3, 6)),
('bytes().partition', 'partition(sep, /)', ['sep'], ge, (3, 6)),
]
)