mirror of
https://github.com/github/codeql.git
synced 2025-12-20 10:46:30 +01:00
Python: Extract version specific coverage/classes.py tests
Since we can analyze operator.py from Python3, but not in Python 2 (since it's implemented in C), we get a difference for the index tests. note: `operator.length_hint` is only available in Python 3.4 and later, so would always fail under Python 2.
This commit is contained in:
@@ -535,21 +535,6 @@ def test_len_if():
|
||||
pass
|
||||
|
||||
|
||||
# object.__length_hint__(self)
|
||||
class With_length_hint:
|
||||
def __length_hint__(self):
|
||||
SINK1(self)
|
||||
OK() # Call not found
|
||||
return 0
|
||||
|
||||
|
||||
def test_length_hint():
|
||||
import operator
|
||||
|
||||
with_length_hint = With_length_hint() #$ arg1="SSA variable with_length_hint" func=With_length_hint.__length_hint__
|
||||
operator.length_hint(with_length_hint)
|
||||
|
||||
|
||||
# object.__getitem__(self, key)
|
||||
class With_getitem:
|
||||
def __getitem__(self, key):
|
||||
@@ -1378,13 +1363,6 @@ class With_index:
|
||||
return 0
|
||||
|
||||
|
||||
def test_index():
|
||||
import operator
|
||||
|
||||
with_index = With_index() #$ arg1="SSA variable with_index" func=With_index.__index__
|
||||
operator.index(with_index)
|
||||
|
||||
|
||||
def test_index_slicing():
|
||||
with_index = With_index() #$ MISSING: arg1="SSA variable with_index" func=With_index.__index__
|
||||
[0][with_index:1]
|
||||
|
||||
Reference in New Issue
Block a user