mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-13 08:01:09 +00:00
Fix test failures with newer flake8 and pylint.
Closes: #891721 Signed-off-by: Mattia Rizzolo <mattia@debian.org>
This commit is contained in:
parent
157411a199
commit
edb49c652c
7
debian/changelog
vendored
7
debian/changelog
vendored
@ -1,3 +1,10 @@
|
||||
ubuntu-dev-tools (0.162) UNRELEASED; urgency=medium
|
||||
|
||||
* Team upload.
|
||||
* Fix test failures with newer flake8 and pylint. Closes: #891721
|
||||
|
||||
-- Mattia Rizzolo <mattia@debian.org> Thu, 08 Mar 2018 12:35:24 +0100
|
||||
|
||||
ubuntu-dev-tools (0.161) unstable; urgency=medium
|
||||
|
||||
* Team upload.
|
||||
|
@ -232,7 +232,7 @@ Content-Type: text/plain; charset=UTF-8
|
||||
'invalid username and password.')
|
||||
s.quit()
|
||||
return
|
||||
except:
|
||||
except smtplib.SMTPException:
|
||||
Logger.error('Unknown SMTP error.')
|
||||
s.quit()
|
||||
return
|
||||
|
@ -73,7 +73,7 @@ class Patch(object):
|
||||
cmd = ["diffstat", "-l", "-p0", self._full_path]
|
||||
process = subprocess.Popen(cmd, stdout=subprocess.PIPE)
|
||||
changed_files = process.communicate()[0]
|
||||
self._changed_files = [l for l in changed_files.split("\n") if l != ""]
|
||||
self._changed_files = [f for f in changed_files.split("\n") if f != ""]
|
||||
|
||||
def get_strip_level(self):
|
||||
"""Returns the stript level for the patch."""
|
||||
|
@ -20,7 +20,7 @@ import sys
|
||||
import locale
|
||||
try:
|
||||
from StringIO import StringIO
|
||||
except:
|
||||
except ImportError:
|
||||
from io import StringIO
|
||||
|
||||
import mock
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
try:
|
||||
from StringIO import StringIO
|
||||
except:
|
||||
except ImportError:
|
||||
from io import StringIO
|
||||
import sys
|
||||
|
||||
|
@ -40,9 +40,10 @@ class PylintTestCase(unittest.TestCase):
|
||||
cmd = [pylint_binary, '--rcfile=ubuntutools/test/pylint.conf', '-E',
|
||||
'--reports=n', '--confidence=HIGH', '--'] + files
|
||||
sys.stderr.write("Running following command:\n{}\n".format(" ".join(cmd)))
|
||||
process = subprocess.Popen(cmd, stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE, close_fds=True)
|
||||
|
||||
out, err = process.communicate()
|
||||
self.assertFalse(err, pylint_binary + ' crashed. Error output:\n' + err.decode())
|
||||
self.assertFalse(out, pylint_binary + " found issues:\n" + out.decode())
|
||||
try:
|
||||
subprocess.check_output(cmd, stderr=subprocess.STDOUT)
|
||||
except subprocess.CalledProcessError as e:
|
||||
self.fail(
|
||||
'%s crashed (%d). Error output:\n%s' %
|
||||
(pylint_binary, e.returncode, e.output.decode())
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user