summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlessandro Portale <alessandro.portale@qt.io>2019-05-02 18:16:47 +0200
committerhjk <hjk@qt.io>2019-05-10 05:53:39 +0000
commit53117088451d486f6ec57cb4339dbe9253bfbc28 (patch)
tree7f04795dccdf84a241468982853eadcd6b4fd824 /tests
parent4f989d6543de221fc4857a8c11750b5645bac7cc (diff)
downloadqt-creator-53117088451d486f6ec57cb4339dbe9253bfbc28.tar.gz
python scripts: Use "not in" operator to test membership
As per suggestion from Pyls, this changes if not needle in haystack: to if needle not in haystack: Change-Id: I4a482604e13e61ecee9e02935479632419710ff7 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Robert Loehning <robert.loehning@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/system/shared/debugger.py2
-rw-r--r--tests/system/shared/qtcreator.py2
-rw-r--r--tests/system/suite_general/tst_create_proj_wizard/test.py2
-rw-r--r--tests/system/suite_general/tst_rename_file/test.py6
4 files changed, 6 insertions, 6 deletions
diff --git a/tests/system/shared/debugger.py b/tests/system/shared/debugger.py
index 28c5398f66..77632241f3 100644
--- a/tests/system/shared/debugger.py
+++ b/tests/system/shared/debugger.py
@@ -255,7 +255,7 @@ def verifyBreakPoint(bpToVerify):
def __isWinFirewallRunning__():
if hasattr(__isWinFirewallRunning__, "fireWallState"):
return __isWinFirewallRunning__.fireWallState
- if not platform.system() in ('Microsoft' 'Windows'):
+ if platform.system() not in ('Microsoft' 'Windows'):
__isWinFirewallRunning__.fireWallState = False
return False
result = getOutputFromCmdline(["netsh", "firewall", "show", "state"])
diff --git a/tests/system/shared/qtcreator.py b/tests/system/shared/qtcreator.py
index 4b909c6e44..c5fa6792b0 100644
--- a/tests/system/shared/qtcreator.py
+++ b/tests/system/shared/qtcreator.py
@@ -292,7 +292,7 @@ def copySettingsToTmpDir(destination=None, omitFiles=[]):
if not os.path.exists(folder):
os.makedirs(folder)
for ff in f:
- if not ff in omitFiles:
+ if ff not in omitFiles:
shutil.copy(os.path.join(r, ff), currentPath)
if platform.system() in ('Linux', 'Darwin'):
substituteTildeWithinToolchains(tmpSettingsDir)
diff --git a/tests/system/suite_general/tst_create_proj_wizard/test.py b/tests/system/suite_general/tst_create_proj_wizard/test.py
index 194d90aa9c..e3bee3b2a4 100644
--- a/tests/system/suite_general/tst_create_proj_wizard/test.py
+++ b/tests/system/suite_general/tst_create_proj_wizard/test.py
@@ -61,7 +61,7 @@ def main():
for template in dumpItems(templatesView.model(), templatesView.rootIndex()):
template = template.replace(".", "\\.")
# skip non-configurable
- if not template in ["Qt Quick UI Prototype", "Auto Test Project", # FIXME
+ if template not in ["Qt Quick UI Prototype", "Auto Test Project", # FIXME
"Qt for Python - Empty", "Qt for Python - Window"]:
availableProjectTypes.append({category:template})
safeClickButton("Cancel")
diff --git a/tests/system/suite_general/tst_rename_file/test.py b/tests/system/suite_general/tst_rename_file/test.py
index ed13ee9a8e..3f0907759a 100644
--- a/tests/system/suite_general/tst_rename_file/test.py
+++ b/tests/system/suite_general/tst_rename_file/test.py
@@ -114,11 +114,11 @@ def renameFile(projectDir, proFile, branch, oldname, newname):
"Comparing content of file before and after renaming")
test.verify(waitFor("newname in safeReadFile(proFile)", 2000),
"Verify that new filename '%s' was added to pro-file." % newname)
- if not oldname in newname:
- test.verify(not oldname in readFile(proFile),
+ if oldname not in newname:
+ test.verify(oldname not in readFile(proFile),
"Verify that old filename '%s' was removed from pro-file." % oldname)
if not (oldname.lower() == newname.lower() and platform.system() in ('Windows', 'Microsoft')):
- test.verify(not oldname in os.listdir(projectDir),
+ test.verify(oldname not in os.listdir(projectDir),
"Verify that file with old name does not exist: %s" % oldFilePath)
def safeReadFile(filename):