aboutsummaryrefslogtreecommitdiffstats
path: root/testing/helper.py
diff options
context:
space:
mode:
authorCristian Maureira-Fredes <Cristian.Maureira-Fredes@qt.io>2020-12-31 01:29:43 +0100
committerCristian Maureira-Fredes <Cristian.Maureira-Fredes@qt.io>2021-01-05 10:18:02 +0100
commit2de3a763fa18d5c30c2cff25057f1b81ceeed231 (patch)
tree4b3920a147714c36e0b4d734090a6d5c646a32e2 /testing/helper.py
parent3f6c13dc7b4241c924b0b4366e3cbc94572737b7 (diff)
testing: solve flake8 warnings
Pick-to: 6.0 Change-Id: I75f1a367c8a86ec586820bd4a45339773c15a70a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'testing/helper.py')
-rw-r--r--testing/helper.py18
1 files changed, 5 insertions, 13 deletions
diff --git a/testing/helper.py b/testing/helper.py
index d192cf061..a8d3a65ff 100644
--- a/testing/helper.py
+++ b/testing/helper.py
@@ -44,26 +44,18 @@ Some tools that do not fit elsewhere.
"""
import os
-import sys
-from collections import namedtuple
-
-from subprocess import PIPE
-from subprocess import TimeoutExpired
-from io import StringIO
script_dir = os.path.dirname(os.path.dirname(__file__))
+
def decorate(mod_name):
"""
Write the combination of "modulename_funcname"
in the Qt-like form "modulename::funcname"
"""
- if "_" not in mod_name:
+ if "_" not in mod_name or "::" in mod_name:
return mod_name
- if "::" in mod_name:
- return mod_name
- name, rest = mod_name.split("_", 1)
- return name + "::" + rest
-
-#eof
+ else:
+ name, rest = mod_name.split("_", 1)
+ return f"{name}::{rest}"