Python: Remove obsolete tests.

This commit is contained in:
Mark Shannon
2019-05-10 13:04:43 +01:00
parent 39861597e5
commit 2db0bd9483
8 changed files with 0 additions and 121 deletions

View File

@@ -1,2 +0,0 @@
| 34 | BasicBlock | Linux |
| 68 | BasicBlock | Windows |

View File

@@ -1,8 +0,0 @@
import python
import semmle.python.types.Version
from OsGuard og, Location l
where l = og.getLastNode().getLocation() and
l.getFile().getName().matches("%test.py")
select l.getStartLine(), og.toString(), og.getOs()

View File

@@ -1,3 +0,0 @@
| 25 | BasicBlock | 2 |
| 28 | BasicBlock | 3 |
| 41 | BasicBlock | 2 |

View File

@@ -1,9 +0,0 @@
import python
import semmle.python.types.Version
from VersionGuard vg, Location l, int v
where l = vg.getLastNode().getLocation() and
l.getFile().getName().matches("%test.py")
and (if vg.isTrue() then v = major_version() else v = 5-major_version())
select l.getStartLine(), vg.toString(), v

View File

@@ -1,15 +0,0 @@
| 15 | ControlFlowNode for Compare | 2 |
| 22 | ControlFlowNode for Compare | 2 |
| 23 | ControlFlowNode for Compare | 3 |
| 51 | ControlFlowNode for Compare | 2 |
| 52 | ControlFlowNode for Compare | 3 |
| 54 | ControlFlowNode for Compare | 2 |
| 55 | ControlFlowNode for Compare | 3 |
| 57 | ControlFlowNode for Compare | 2 |
| 58 | ControlFlowNode for Compare | 3 |
| 59 | ControlFlowNode for Compare | 3 |
| 60 | ControlFlowNode for Compare | 2 |
| 61 | ControlFlowNode for Compare | 3 |
| 62 | ControlFlowNode for Compare | 2 |
| 65 | ControlFlowNode for Compare | 2 |
| 66 | ControlFlowNode for Compare | 3 |

View File

@@ -1,9 +0,0 @@
import python
import semmle.python.types.Version
from VersionTest vt, Location l, int v
where l = vt.getNode().getLocation() and
l.getFile().getName().matches("%test.py")
and (if vt.isTrue() then v = major_version() else v = 5-major_version())
select l.getStartLine(), vt.(ControlFlowNode).toString(), v

View File

@@ -1,5 +0,0 @@
import sys
os_test = sys.platform == "linux"
version_test = sys.version_info < (3,)

View File

@@ -1,70 +0,0 @@
import sys
os_test = sys.platform == "win32"
version_test = sys.version_info < (3,)
from module import os_test as t2
from module import version_test as t3
# Tests from six
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3
if PY2:
version = 2
if PY3:
version = 3
if version == 2:
print("Version 2")
if t2:
class G: pass
else:
def G(): pass
g = G
if t3:
class H: pass
else:
def H(): pass
h = H
#Some other forms of check.
#Hexversion check (unlikely but a valid test)
PY2a = sys.hexversion < 0x03000000
PY3a = sys.hexversion >= 0x03000000
PY2b = sys.hexversion < 0x03000000
PY3b = sys.hexversion >= 0x03000000
PY2c = sys.version_info < (3,)
PY3c = sys.version_info >= (3,)
Py3d = sys.version_info >= (3,4) # Specific version of Python 3, rules out Python 2
Py2d = sys.version_info < (2,7)
Py3e = sys.version_info[:2] >= (3,3)
Py2f = sys.version_info[:2] < (2,7)
#From problem_report
Py2g = sys.version[0] < '3'
Py3h = sys.version[0] >= '3'
if os_test:
pass