diff options
author | Mats Wichmann <mats@linux.com> | 2019-12-21 18:56:08 (GMT) |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2019-12-21 18:56:08 (GMT) |
commit | 7ba3919aa8d401d07c6920c6b84dc657a381cb5e (patch) | |
tree | 5281ec8b6cd06b418c4b8ecb004fcc9949fa9a77 /testing | |
parent | 7967da09b1447e2ac452c01fd1e0aa040b70fa5f (diff) | |
download | SCons-7ba3919aa8d401d07c6920c6b84dc657a381cb5e.zip SCons-7ba3919aa8d401d07c6920c6b84dc657a381cb5e.tar.gz SCons-7ba3919aa8d401d07c6920c6b84dc657a381cb5e.tar.bz2 |
checker fixes: None, trailing ws, list init
checker-suggested fixes:
Mostly, fix remaining instances of comparing none without "is"
Some trailing whitespace on lines
A couple of instances of list init followed immediately by
several appends, turned into a single list init
Some double comparisons turned into a single expression
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 | 18 |
2 files changed, 10 insertions, 10 deletions
diff --git a/testing/framework/TestCmd.py b/testing/framework/TestCmd.py index 9218f60..447d050 100644 --- a/testing/framework/TestCmd.py +++ b/testing/framework/TestCmd.py @@ -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..541df71 100644 --- a/testing/framework/TestCmdTests.py +++ b/testing/framework/TestCmdTests.py @@ -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'], @@ -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) |