diff options
author | MarcoFalke <falke.marco@gmail.com> | 2018-03-19 09:54:15 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2018-03-19 09:54:17 -0400 |
commit | 872c921c0a208b04bd0713758e52fcab5b7c1684 (patch) | |
tree | d8796319131a7e5c2cca443d763a45abaeed54e1 /test/functional | |
parent | 00d1680498c5550e7db1f359202d3433a092fafd (diff) | |
parent | 0dbb32b2cba54408bea12099d64e0fefa3651460 (diff) |
Merge #12720: qa: Avoiding 'file' function name from python2
0dbb32b2cb Avoiding 'file' function name from python2 with more descriptive variable naming (Jeff Rade)
Pull request description:
@jnewbery Here is PR from review in [#12437](https://github.com/bitcoin/bitcoin/pull/12437)
Tree-SHA512: c61980f4d3170842627cd970e1f6eebaf303843dc5e95a9dcfe3ded08152be533774cb75f56a83af8452b6bcac17c0172cf20e39edf9acefb4a4c255fe893a3b
Diffstat (limited to 'test/functional')
-rwxr-xr-x | test/functional/test_runner.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py index 673cdb5066..09f7f50de0 100755 --- a/test/functional/test_runner.py +++ b/test/functional/test_runner.py @@ -433,7 +433,7 @@ class TestHandler: proc.send_signal(signal.SIGINT) if proc.poll() is not None: log_out.seek(0), log_err.seek(0) - [stdout, stderr] = [file.read().decode('utf-8') for file in (log_out, log_err)] + [stdout, stderr] = [log_file.read().decode('utf-8') for log_file in (log_out, log_err)] log_out.close(), log_err.close() if proc.returncode == TEST_EXIT_PASSED and stderr == "": status = "Passed" @@ -490,7 +490,7 @@ def check_script_list(src_dir): Check that there are no scripts in the functional tests directory which are not being run by pull-tester.py.""" script_dir = src_dir + '/test/functional/' - python_files = set([file for file in os.listdir(script_dir) if file.endswith(".py")]) + python_files = set([test_file for test_file in os.listdir(script_dir) if test_file.endswith(".py")]) missed_tests = list(python_files - set(map(lambda x: x.split()[0], ALL_SCRIPTS + NON_SCRIPTS))) if len(missed_tests) != 0: print("%sWARNING!%s The following scripts are not being run: %s. Check the test lists in test_runner.py." % (BOLD[1], BOLD[0], str(missed_tests))) @@ -550,8 +550,8 @@ class RPCCoverage(): if not os.path.isfile(coverage_ref_filename): raise RuntimeError("No coverage reference found") - with open(coverage_ref_filename, 'r') as file: - all_cmds.update([line.strip() for line in file.readlines()]) + with open(coverage_ref_filename, 'r') as coverage_ref_file: + all_cmds.update([line.strip() for line in coverage_ref_file.readlines()]) for root, dirs, files in os.walk(self.dir): for filename in files: @@ -559,8 +559,8 @@ class RPCCoverage(): coverage_filenames.add(os.path.join(root, filename)) for filename in coverage_filenames: - with open(filename, 'r') as file: - covered_cmds.update([line.strip() for line in file.readlines()]) + with open(filename, 'r') as coverage_file: + covered_cmds.update([line.strip() for line in coverage_file.readlines()]) return all_cmds - covered_cmds |