aboutsummaryrefslogtreecommitdiffstats
path: root/tests/system/shared
diff options
context:
space:
mode:
authorRobert Loehning <robert.loehning@qt.io>2018-08-02 13:45:34 +0200
committerRobert Loehning <robert.loehning@qt.io>2018-08-06 14:21:30 +0000
commitff10f8c3a58c2c57e221e294d5c4829c3fd05c15 (patch)
treec8db8d36d315effe5b7fb3403d32f13416281352 /tests/system/shared
parentc1f78335e005b311ce3eac94ca48cc573f50a56d (diff)
Squish: Fix warnings
Warnings from static code checks, that is, not test.warning() at runtime. Change-Id: I651d13491106583908059ecdb5f700f539b6d9c8 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'tests/system/shared')
-rw-r--r--tests/system/shared/build_utils.py2
-rw-r--r--tests/system/shared/classes.py1
-rw-r--r--tests/system/shared/debugger.py6
-rw-r--r--tests/system/shared/editor_utils.py7
-rw-r--r--tests/system/shared/project_explorer.py4
-rw-r--r--tests/system/shared/utils.py4
6 files changed, 10 insertions, 14 deletions
diff --git a/tests/system/shared/build_utils.py b/tests/system/shared/build_utils.py
index d2d1f59600..0aaab2ac33 100644
--- a/tests/system/shared/build_utils.py
+++ b/tests/system/shared/build_utils.py
@@ -37,7 +37,7 @@ def getBuildIssues():
def checkLastBuild(expectedToFail=False, createTasksFileOnError=True):
try:
# can't use waitForObject() 'cause visible is always 0
- buildProg = findObject("{type='ProjectExplorer::Internal::BuildProgress' unnamed='1' }")
+ findObject("{type='ProjectExplorer::Internal::BuildProgress' unnamed='1' }")
except LookupError:
test.log("checkLastBuild called without a build")
return
diff --git a/tests/system/shared/classes.py b/tests/system/shared/classes.py
index c4db7046e2..a8bdbf9664 100644
--- a/tests/system/shared/classes.py
+++ b/tests/system/shared/classes.py
@@ -24,7 +24,6 @@
############################################################################
import __builtin__
-import operator
# for easier re-usage (because Python hasn't an enum type)
class Targets:
diff --git a/tests/system/shared/debugger.py b/tests/system/shared/debugger.py
index b3cf7988a9..1a1fc39a56 100644
--- a/tests/system/shared/debugger.py
+++ b/tests/system/shared/debugger.py
@@ -23,8 +23,6 @@
#
############################################################################
-import re
-
def handleDebuggerWarnings(config, isMsvcBuild=False):
if isMsvcBuild:
try:
@@ -71,8 +69,8 @@ def setBreakpointsForCurrentProject(filesAndLines):
if not filesAndLines or not isinstance(filesAndLines, (list,tuple)):
test.fatal("This function only takes a non-empty list/tuple holding dicts.")
return False
- navTree = waitForObject("{type='Utils::NavigationTreeView' unnamed='1' visible='1' "
- "window=':Qt Creator_Core::Internal::MainWindow'}")
+ waitForObject("{type='Utils::NavigationTreeView' unnamed='1' visible='1' "
+ "window=':Qt Creator_Core::Internal::MainWindow'}")
for current in filesAndLines:
for curFile,curLine in current.iteritems():
if not openDocument(curFile):
diff --git a/tests/system/shared/editor_utils.py b/tests/system/shared/editor_utils.py
index 09b3af6ae7..df3f7d37ea 100644
--- a/tests/system/shared/editor_utils.py
+++ b/tests/system/shared/editor_utils.py
@@ -106,7 +106,7 @@ def openContextMenuOnTextCursorPosition(editor):
# param direction is one of "Left", "Right", "Up", "Down", but "End" and combinations work as well
# param typeCount defines how often the cursor will be moved in the given direction (while marking)
def markText(editor, direction, typeCount=1):
- for i in range(typeCount):
+ for _ in range(typeCount):
type(editor, "<Shift+%s>" % direction)
# works for all standard editors
@@ -173,7 +173,7 @@ def verifyHoveringOnEditor(editor, lines, additionalKeyPresses, expectedTypes, e
# param expectedVals a dict holding property value pairs that must match
def __handleTextTips__(textTip, expectedVals, alternativeVals):
props = object.properties(textTip)
- expFail = altFail = False
+ expFail = False
eResult = verifyProperties(props, expectedVals)
for val in eResult.itervalues():
if not val:
@@ -182,7 +182,6 @@ def __handleTextTips__(textTip, expectedVals, alternativeVals):
if expFail and alternativeVals != None:
aResult = verifyProperties(props, alternativeVals)
else:
- altFail = True
aResult = None
if not expFail:
test.passes("TextTip verified")
@@ -360,7 +359,7 @@ def invokeContextMenuItem(editorArea, command1, command2 = None):
def invokeFindUsage(editor, line, typeOperation, n=1):
if not placeCursorToLine(editor, line, True):
return False
- for i in range(n):
+ for _ in range(n):
type(editor, typeOperation)
snooze(1)
invokeContextMenuItem(editor, "Find Usages")
diff --git a/tests/system/shared/project_explorer.py b/tests/system/shared/project_explorer.py
index 336d82fc48..2ad9a32957 100644
--- a/tests/system/shared/project_explorer.py
+++ b/tests/system/shared/project_explorer.py
@@ -42,7 +42,7 @@ def switchViewTo(view):
text = ""
pattern = ViewConstants.getToolTipForViewTab(view)
if re.match(pattern, unicode(text), re.UNICODE):
- test.passes("ToolTip verified")
+ test.passes("ToolTip verified")
else:
test.warning("ToolTip does not match", "Expected pattern: %s\nGot: %s" % (pattern, text))
mouseClick(waitForObject("{type='Core::Internal::FancyTabBar' unnamed='1' visible='1' "
@@ -158,7 +158,7 @@ def addAndActivateKit(kit):
kitString = Targets.getStringForTarget(kit)
switchViewTo(ViewConstants.PROJECTS)
try:
- treeView = waitForObject(":Projects.ProjectNavigationTreeView")
+ waitForObject(":Projects.ProjectNavigationTreeView")
wanted = getQModelIndexStr("text='%s'" % kitString, bAndRIndex)
index = findObject(wanted)
if str(index.toolTip).startswith(clickToActivate):
diff --git a/tests/system/shared/utils.py b/tests/system/shared/utils.py
index 590b277a1e..097772769d 100644
--- a/tests/system/shared/utils.py
+++ b/tests/system/shared/utils.py
@@ -458,7 +458,7 @@ def iterateQtVersions(keepOptionsOpen=False, alreadyOnOptionsDialog=False,
currResult = additionalFunction(target, version, *argsForAdditionalFunc)
except:
import sys
- t,v,tb = sys.exc_info()
+ t,v,_ = sys.exc_info()
currResult = None
test.fatal("Function to additionally execute on Options Dialog could not be found or "
"an exception occurred while executing it.", "%s(%s)" % (str(t), str(v)))
@@ -521,7 +521,7 @@ def iterateKits(keepOptionsOpen=False, alreadyOnOptionsDialog=False,
currResult = additionalFunction(item, kitName, *argsForAdditionalFunc)
except:
import sys
- t,v,tb = sys.exc_info()
+ t,v,_ = sys.exc_info()
currResult = None
test.fatal("Function to additionally execute on Options Dialog could not be "
"found or an exception occurred while executing it.", "%s(%s)" %