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
|
ubuntu-dev-tools (0.161) unstable; urgency=medium
|
||||||
|
|
||||||
* Team upload.
|
* Team upload.
|
||||||
|
@ -232,7 +232,7 @@ Content-Type: text/plain; charset=UTF-8
|
|||||||
'invalid username and password.')
|
'invalid username and password.')
|
||||||
s.quit()
|
s.quit()
|
||||||
return
|
return
|
||||||
except:
|
except smtplib.SMTPException:
|
||||||
Logger.error('Unknown SMTP error.')
|
Logger.error('Unknown SMTP error.')
|
||||||
s.quit()
|
s.quit()
|
||||||
return
|
return
|
||||||
|
@ -73,7 +73,7 @@ class Patch(object):
|
|||||||
cmd = ["diffstat", "-l", "-p0", self._full_path]
|
cmd = ["diffstat", "-l", "-p0", self._full_path]
|
||||||
process = subprocess.Popen(cmd, stdout=subprocess.PIPE)
|
process = subprocess.Popen(cmd, stdout=subprocess.PIPE)
|
||||||
changed_files = process.communicate()[0]
|
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):
|
def get_strip_level(self):
|
||||||
"""Returns the stript level for the patch."""
|
"""Returns the stript level for the patch."""
|
||||||
|
@ -20,7 +20,7 @@ import sys
|
|||||||
import locale
|
import locale
|
||||||
try:
|
try:
|
||||||
from StringIO import StringIO
|
from StringIO import StringIO
|
||||||
except:
|
except ImportError:
|
||||||
from io import StringIO
|
from io import StringIO
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
from StringIO import StringIO
|
from StringIO import StringIO
|
||||||
except:
|
except ImportError:
|
||||||
from io import StringIO
|
from io import StringIO
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
@ -40,9 +40,10 @@ class PylintTestCase(unittest.TestCase):
|
|||||||
cmd = [pylint_binary, '--rcfile=ubuntutools/test/pylint.conf', '-E',
|
cmd = [pylint_binary, '--rcfile=ubuntutools/test/pylint.conf', '-E',
|
||||||
'--reports=n', '--confidence=HIGH', '--'] + files
|
'--reports=n', '--confidence=HIGH', '--'] + files
|
||||||
sys.stderr.write("Running following command:\n{}\n".format(" ".join(cmd)))
|
sys.stderr.write("Running following command:\n{}\n".format(" ".join(cmd)))
|
||||||
process = subprocess.Popen(cmd, stdout=subprocess.PIPE,
|
try:
|
||||||
stderr=subprocess.PIPE, close_fds=True)
|
subprocess.check_output(cmd, stderr=subprocess.STDOUT)
|
||||||
|
except subprocess.CalledProcessError as e:
|
||||||
out, err = process.communicate()
|
self.fail(
|
||||||
self.assertFalse(err, pylint_binary + ' crashed. Error output:\n' + err.decode())
|
'%s crashed (%d). Error output:\n%s' %
|
||||||
self.assertFalse(out, pylint_binary + " found issues:\n" + out.decode())
|
(pylint_binary, e.returncode, e.output.decode())
|
||||||
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user