summaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2019-12-29 03:15:52 (GMT)
committerGitHub <noreply@github.com>2019-12-29 03:15:52 (GMT)
commit643bdf9c989713e69b3c34700cbed98e9816f663 (patch)
treebe4f0f9d098711851ede4fa6ecff8ec339928f9a /testing
parentf5251e030120b729c17dae4de7e7e7efb8651e0e (diff)
parent37a9d36e9939bccd165885333a7c7b2870e85565 (diff)
downloadSCons-643bdf9c989713e69b3c34700cbed98e9816f663.zip
SCons-643bdf9c989713e69b3c34700cbed98e9816f663.tar.gz
SCons-643bdf9c989713e69b3c34700cbed98e9816f663.tar.bz2
Merge branch 'master' into topic/grossag/pythonscanner
Diffstat (limited to 'testing')
-rw-r--r--testing/framework/TestCmd.py4
-rw-r--r--testing/framework/TestCmdTests.py26
-rw-r--r--testing/framework/TestSCons.py2
-rw-r--r--testing/framework/TestUnit/taprunner.py2
4 files changed, 17 insertions, 17 deletions
diff --git a/testing/framework/TestCmd.py b/testing/framework/TestCmd.py
index 9218f60..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)
@@ -1805,7 +1805,7 @@ class TestCmd(object):
path name. If the path is a null string (''), a unique
directory name is created.
"""
- if (path != None):
+ if path is not None:
if path == '':
path = None
path = self.tempdir(path)
diff --git a/testing/framework/TestCmdTests.py b/testing/framework/TestCmdTests.py
index ef76228..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')
@@ -1737,7 +1737,7 @@ class run_TestCase(TestCmdTestCase):
pass
test.run(program = 'no_script', interpreter = 'python')
- assert test.status != None, test.status
+ assert test.status is not None, test.status
try:
test.run(program = 'no_script', interpreter = 'no_interpreter')
@@ -1750,7 +1750,7 @@ class run_TestCase(TestCmdTestCase):
# Python versions that use os.popen3() or the Popen3
# class run things through the shell, which just returns
# a non-zero exit status.
- assert test.status != None, test.status
+ assert test.status is not None, test.status
testx = TestCmd.TestCmd(program = t.scriptx,
workdir = '',
@@ -1816,7 +1816,7 @@ class run_TestCase(TestCmdTestCase):
# Python versions that use os.popen3() or the Popen3
# class run things through the shell, which just returns
# a non-zero exit status.
- assert test.status != None
+ assert test.status is not None
test1 = TestCmd.TestCmd(program = t.script1,
interpreter = ['python', '-x'],
@@ -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.
@@ -2388,7 +2388,7 @@ with open(r'%s', 'wb') as logfp:
p = test.start(program='no_script', interpreter='python')
status = p.wait()
- assert status != None, status
+ assert status is not None, status
try:
p = test.start(program='no_script', interpreter='no_interpreter')
@@ -2402,7 +2402,7 @@ with open(r'%s', 'wb') as logfp:
# Python versions that use os.popen3() or the Popen3
# class run things through the shell, which just returns
# a non-zero exit status.
- assert status != None, status
+ assert status is not None, status
testx = TestCmd.TestCmd(program = t.scriptx,
workdir = '',
@@ -3054,11 +3054,11 @@ class workdir_TestCase(TestCmdTestCase):
assert test.workdir is None
test = TestCmd.TestCmd(workdir = '')
- assert test.workdir != None
+ assert test.workdir is not None
assert os.path.isdir(test.workdir)
test = TestCmd.TestCmd(workdir = 'dir')
- assert test.workdir != None
+ assert test.workdir is not None
assert os.path.isdir(test.workdir)
no_such_subdir = os.path.join('no', 'such', 'subdir')
@@ -3071,11 +3071,11 @@ class workdir_TestCase(TestCmdTestCase):
test = TestCmd.TestCmd(workdir = 'foo')
workdir_foo = test.workdir
- assert workdir_foo != None
+ assert workdir_foo is not None
test.workdir_set('bar')
workdir_bar = test.workdir
- assert workdir_bar != None
+ assert workdir_bar is not None
try:
test.workdir_set(no_such_subdir)
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)