diff options
author | Mats Wichmann <mats@linux.com> | 2019-12-22 15:44:29 (GMT) |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2019-12-23 16:52:35 (GMT) |
commit | a5359e3f10a6bcdb5d9667c95c40ddd890b551e8 (patch) | |
tree | dd587ca78a6d4542c6bd968e4590b6671464d39d /testing | |
parent | 5a864bae1380155997f4041d607e4abcf74652ca (diff) | |
download | SCons-a5359e3f10a6bcdb5d9667c95c40ddd890b551e8.zip SCons-a5359e3f10a6bcdb5d9667c95c40ddd890b551e8.tar.gz SCons-a5359e3f10a6bcdb5d9667c95c40ddd890b551e8.tar.bz2 |
syntax fixups suggested by PyCharm
Drop unneeded parens.
Drop trailing semicolons.
Triple double-quote docstrings.
Regexes drop unneeded escapes.
Spaces around parens, braces: remove/add.
Some one-tuples get their missing closing comma.
A couple of sets use set init syntax {foo} instead of set([iter]) now.
And a fiddle in Node to reduce lookup time on md5 signature functions
(came about because of a line-too-long issue, initially)
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'testing')
-rw-r--r-- | testing/framework/TestCmd.py | 2 | ||||
-rw-r--r-- | testing/framework/TestCmdTests.py | 8 | ||||
-rw-r--r-- | testing/framework/TestSCons.py | 2 | ||||
-rw-r--r-- | testing/framework/TestUnit/taprunner.py | 2 |
4 files changed, 7 insertions, 7 deletions
diff --git a/testing/framework/TestCmd.py b/testing/framework/TestCmd.py index 447d050..b98445c 100644 --- a/testing/framework/TestCmd.py +++ b/testing/framework/TestCmd.py @@ -667,7 +667,7 @@ def diff_re(a, b, fromfile='', tofile='', if os.name == 'posix': def escape(arg): - "escape shell special characters" + """escape shell special characters""" slash = '\\' special = '"$' arg = arg.replace(slash, slash + slash) diff --git a/testing/framework/TestCmdTests.py b/testing/framework/TestCmdTests.py index 541df71..0c7b455 100644 --- a/testing/framework/TestCmdTests.py +++ b/testing/framework/TestCmdTests.py @@ -121,8 +121,8 @@ class TestCmdTestCase(unittest.TestCase): else: textx = '#! /usr/bin/env python\n' + textx + '\n' text1 = 'A first line to be ignored!\n' + fmt % (t.script1, t.script1) - textout = fmtout % (t.scriptout) - texterr = fmterr % (t.scripterr) + textout = fmtout % t.scriptout + texterr = fmterr % t.scripterr run_env = TestCmd.TestCmd(workdir = '') run_env.subdir('sub dir') @@ -1974,7 +1974,7 @@ class run_verbose_TestCase(TestCmdTestCase): assert expect == o, (expect, o) e = sys.stderr.getvalue() - expect = 'python "%s" "arg1 arg2"\n' % (t.scriptout_path) + expect = 'python "%s" "arg1 arg2"\n' % t.scriptout_path assert e == expect, (e, expect) test = TestCmd.TestCmd(program = t.scriptout, @@ -1993,7 +1993,7 @@ class run_verbose_TestCase(TestCmdTestCase): assert expect == o, (expect, o) e = sys.stderr.getvalue() - expect = 'python "%s" "arg1 arg2"\n' % (t.scriptout_path) + expect = 'python "%s" "arg1 arg2"\n' % t.scriptout_path assert e == expect, (e, expect) # Test letting TestCmd() pick up verbose = 2 from the environment. diff --git a/testing/framework/TestSCons.py b/testing/framework/TestSCons.py index d1aed28..a633617 100644 --- a/testing/framework/TestSCons.py +++ b/testing/framework/TestSCons.py @@ -817,7 +817,7 @@ class TestSCons(TestCommon): sp = subprocess.Popen([where_java_bin, "-version"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = sp.communicate() sp.wait() - if("No Java runtime" in str(stderr)): + if "No Java runtime" in str(stderr): self.skip_test("Could not find Java " + java_bin_name + ", skipping test(s).\n") def java_where_jar(self, version=None): diff --git a/testing/framework/TestUnit/taprunner.py b/testing/framework/TestUnit/taprunner.py index 5c2e87c..0dde327 100644 --- a/testing/framework/TestUnit/taprunner.py +++ b/testing/framework/TestUnit/taprunner.py @@ -62,7 +62,7 @@ class TAPTestResult(TextTestResult): def addExpectedFailure(self, test, err): super(TextTestResult, self).addExpectedFailure(test, err) - self._process(test, "not ok", directive=(" # TODO")) + self._process(test, "not ok", directive=" # TODO") def addUnexpectedSuccess(self, test): super(TextTestResult, self).addUnexpectedSuccess(test) |