Skip to content

Commit 872c921

Browse files
author
MarcoFalke
committed
Merge #12720: qa: Avoiding 'file' function name from python2
0dbb32b Avoiding 'file' function name from python2 with more descriptive variable naming (Jeff Rade) Pull request description: @jnewbery Here is PR from review in [#12437](bitcoin/bitcoin#12437) Tree-SHA512: c61980f4d3170842627cd970e1f6eebaf303843dc5e95a9dcfe3ded08152be533774cb75f56a83af8452b6bcac17c0172cf20e39edf9acefb4a4c255fe893a3b
2 parents 00d1680 + 0dbb32b commit 872c921

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/functional/test_runner.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ def get_next(self):
433433
proc.send_signal(signal.SIGINT)
434434
if proc.poll() is not None:
435435
log_out.seek(0), log_err.seek(0)
436-
[stdout, stderr] = [file.read().decode('utf-8') for file in (log_out, log_err)]
436+
[stdout, stderr] = [log_file.read().decode('utf-8') for log_file in (log_out, log_err)]
437437
log_out.close(), log_err.close()
438438
if proc.returncode == TEST_EXIT_PASSED and stderr == "":
439439
status = "Passed"
@@ -490,7 +490,7 @@ def check_script_list(src_dir):
490490
Check that there are no scripts in the functional tests directory which are
491491
not being run by pull-tester.py."""
492492
script_dir = src_dir + '/test/functional/'
493-
python_files = set([file for file in os.listdir(script_dir) if file.endswith(".py")])
493+
python_files = set([test_file for test_file in os.listdir(script_dir) if test_file.endswith(".py")])
494494
missed_tests = list(python_files - set(map(lambda x: x.split()[0], ALL_SCRIPTS + NON_SCRIPTS)))
495495
if len(missed_tests) != 0:
496496
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,17 +550,17 @@ def _get_uncovered_rpc_commands(self):
550550
if not os.path.isfile(coverage_ref_filename):
551551
raise RuntimeError("No coverage reference found")
552552

553-
with open(coverage_ref_filename, 'r') as file:
554-
all_cmds.update([line.strip() for line in file.readlines()])
553+
with open(coverage_ref_filename, 'r') as coverage_ref_file:
554+
all_cmds.update([line.strip() for line in coverage_ref_file.readlines()])
555555

556556
for root, dirs, files in os.walk(self.dir):
557557
for filename in files:
558558
if filename.startswith(coverage_file_prefix):
559559
coverage_filenames.add(os.path.join(root, filename))
560560

561561
for filename in coverage_filenames:
562-
with open(filename, 'r') as file:
563-
covered_cmds.update([line.strip() for line in file.readlines()])
562+
with open(filename, 'r') as coverage_file:
563+
covered_cmds.update([line.strip() for line in coverage_file.readlines()])
564564

565565
return all_cmds - covered_cmds
566566

0 commit comments

Comments
 (0)