mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
Disable more tests in Python2.6, because of set literals that don't exist there.
This commit is contained in:
@@ -366,8 +366,6 @@ tuple(a)[1]
|
||||
#? int() str()
|
||||
tuple(list(set(a)))[1]
|
||||
|
||||
#? int()
|
||||
tuple({1})[0]
|
||||
#? int()
|
||||
tuple((1,))[0]
|
||||
|
||||
@@ -404,6 +402,12 @@ def test_func():
|
||||
#? str()
|
||||
x
|
||||
|
||||
|
||||
# python >= 2.7
|
||||
# Set literals are not valid in 2.6.
|
||||
#? int()
|
||||
tuple({1})[0]
|
||||
|
||||
# python >= 3.3
|
||||
# -----------------
|
||||
# PEP 3132 Extended Iterable Unpacking (star unpacking)
|
||||
|
||||
@@ -48,18 +48,6 @@ for a in arr:
|
||||
#? float() str()
|
||||
list(arr)[10]
|
||||
|
||||
# -----------------
|
||||
# set.add
|
||||
# -----------------
|
||||
st = {1.0}
|
||||
for a in [1,2]:
|
||||
st.add(a)
|
||||
|
||||
st.append('') # lists should not have an influence
|
||||
|
||||
st.add # should not cause an exception
|
||||
st.add()
|
||||
|
||||
# -----------------
|
||||
# list.extend / set.update
|
||||
# -----------------
|
||||
@@ -103,15 +91,6 @@ arr2.append('')
|
||||
arr2[0]
|
||||
|
||||
|
||||
st = {1.0}
|
||||
st.add(1)
|
||||
lst = list(st)
|
||||
|
||||
lst.append('')
|
||||
|
||||
#? float() int() str()
|
||||
lst[0]
|
||||
|
||||
lst = [1]
|
||||
lst.append(1.0)
|
||||
s = set(lst)
|
||||
@@ -304,3 +283,28 @@ def third():
|
||||
return list(b)
|
||||
#?
|
||||
third()[0]
|
||||
|
||||
|
||||
# -----------------
|
||||
# set.add
|
||||
# -----------------
|
||||
# Set literals are not valid in 2.6.
|
||||
# python >= 2.7
|
||||
st = {1.0}
|
||||
for a in [1,2]:
|
||||
st.add(a)
|
||||
|
||||
st.append('') # lists should not have an influence
|
||||
|
||||
st.add # should not cause an exception
|
||||
st.add()
|
||||
|
||||
st = {1.0}
|
||||
st.add(1)
|
||||
lst = list(st)
|
||||
|
||||
lst.append('')
|
||||
|
||||
#? float() int() str()
|
||||
lst[0]
|
||||
|
||||
|
||||
@@ -91,19 +91,6 @@ d.items()[0][0]
|
||||
#? int()
|
||||
d.items()[0][1]
|
||||
|
||||
# -----------------
|
||||
# set
|
||||
# -----------------
|
||||
set_t = {1,2}
|
||||
|
||||
#? ['clear', 'copy']
|
||||
set_t.c
|
||||
|
||||
set_t2 = set()
|
||||
|
||||
#? ['clear', 'copy']
|
||||
set_t2.c
|
||||
|
||||
# -----------------
|
||||
# tuples
|
||||
# -----------------
|
||||
@@ -125,3 +112,18 @@ tup3.index
|
||||
tup4 = 1,""
|
||||
#? ['index']
|
||||
tup4.index
|
||||
|
||||
# -----------------
|
||||
# set
|
||||
# -----------------
|
||||
# Set literals are not valid in 2.6.
|
||||
# python >= 2.7
|
||||
set_t = {1,2}
|
||||
|
||||
#? ['clear', 'copy']
|
||||
set_t.c
|
||||
|
||||
set_t2 = set()
|
||||
|
||||
#? ['clear', 'copy']
|
||||
set_t2.c
|
||||
|
||||
@@ -295,6 +295,9 @@ x = 32
|
||||
#< 7 (0,1), (0,7)
|
||||
[x for x in something]
|
||||
|
||||
x = 3
|
||||
# Not supported syntax in Python 2.6.
|
||||
# python >= 2.7
|
||||
#< 1 (0,1), (0,10)
|
||||
{x:1 for x in something}
|
||||
#< 10 (0,1), (0,10)
|
||||
|
||||
Reference in New Issue
Block a user