Fix some pylint warnings

This commit is contained in:
Brian C. Lane 2018-03-22 17:25:00 -07:00
parent c15f3c89fa
commit 47a3980b12
4 changed files with 6 additions and 7 deletions

View File

@ -218,8 +218,8 @@ class LoraxTemplateRunner(object):
# log the "ErrorType: this is what happened" line
logger.error(" " + exclines[-1].strip())
# and log the entire traceback to the debug log
for line in ''.join(exclines).splitlines():
logger.debug(" " + line)
for l in ''.join(exclines).splitlines():
logger.debug(" " + l)
if self.fatalerrors:
raise

View File

@ -14,7 +14,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import inspect
import unittest
from flask import Flask
from datetime import timedelta
@ -97,7 +96,7 @@ class CrossdomainTest(unittest.TestCase):
# when attach_to_all is False the decorator will not assign
# the Access-Control-* headers to the response
for header, value in response.headers:
for header, _ in response.headers:
self.assertFalse(header.startswith('Access-Control-'))

View File

@ -518,8 +518,8 @@ class ServerTestCase(unittest.TestCase):
self.assertEqual(200, response.status_code)
self.assertTrue(len(response.data) > 1024)
# look for some well known strings inside the documentation
self.assertRegexpMatches(response.data, "Lorax [\d.]+ documentation")
self.assertRegexpMatches(response.data, "Copyright \d+, Red Hat, Inc.")
self.assertRegexpMatches(response.data, r"Lorax [\d.]+ documentation")
self.assertRegexpMatches(response.data, r"Copyright \d+, Red Hat, Inc.")
def test_api_docs(self):
"""Test the /api/docs/"""

View File

@ -72,7 +72,7 @@ class WorkspaceTest(unittest.TestCase):
# The recipe was written by the workspace_write test.
with self.assertRaises(recipes.RecipeFileError):
with mock.patch('pylorax.api.workspace.recipe_from_toml', side_effect=IOError('TESTING')):
recipe = workspace_read(self.repo, "master", "http-server")
workspace_read(self.repo, "master", "http-server")
def test_05_workspace_delete(self):
"""Test the workspace_delete function"""