From 6ad31a4923fb12686aa5b740feef18b7dd9d54d9 Mon Sep 17 00:00:00 2001 From: Ed Leafe Date: Thu, 12 Apr 2018 17:54:15 +0000 Subject: [PATCH] Remove use of Python builtin name for variables 'file' is a Python builtin name, and should not be used for a variable name. Fixes-Bug: #1763469 Change-Id: Ifb0a3fe51f995cee5d703be23ea444da3e837be6 --- tests/test_titles.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/test_titles.py b/tests/test_titles.py index 84702c4..761ef78 100644 --- a/tests/test_titles.py +++ b/tests/test_titles.py @@ -87,22 +87,22 @@ class TestTitles(testtools.TestCase): def test_template(self): - files = glob.glob("guidelines/*") - for file in files: - if file.endswith('~'): + filenames = glob.glob("guidelines/*") + for filename in filenames: + if filename.endswith('~'): continue - if os.path.isdir(file): + if os.path.isdir(filename): continue self.assertTrue( - file.endswith(".rst") or file.endswith(".json"), + filename.endswith(".rst") or filename.endswith(".json"), "guideline file must use 'rst' or 'json'" - "extension: {file}".format(file=file)) - with open(file) as f: + "extension: {filename}".format(filename=filename)) + with open(filename) as f: data = f.read() spec = docutils.core.publish_doctree(data) - self._check_no_cr(file, data) - self._check_trailing_spaces(file, data) + self._check_no_cr(filename, data) + self._check_trailing_spaces(filename, data) - if file.endswith(".rst"): - self._check_lines_wrapping(file, data) + if filename.endswith(".rst"): + self._check_lines_wrapping(filename, data)