Merge lp:~salgado/linaro-image-tools/bug-892391 into lp:linaro-image-tools/11.11

Proposed by Guilherme Salgado
Status: Merged
Merged at revision: 465
Proposed branch: lp:~salgado/linaro-image-tools/bug-892391
Merge into: lp:linaro-image-tools/11.11
Diff against target: 51 lines (+6/-11)
3 files modified
README (+2/-2)
linaro_image_tools/tests/test_pyflakes.py (+1/-5)
linaro_image_tools/utils.py (+3/-4)
To merge this branch: bzr merge lp:~salgado/linaro-image-tools/bug-892391
Reviewer Review Type Date Requested Status
Loïc Minier (community) Approve
Review via email: mp+82883@code.launchpad.net

Description of the change

Use testtools.try_import for CommandNotFound; that way our pyflakes test can expect a clean output.
(try_import was added in testtools 0.9.8, but that version is available in our PPA for Maverick/Lucid and is present in the archives for newer releases)

To post a comment you must log in.
Revision history for this message
Loïc Minier (lool) wrote :

 review approve

 Cool, thanks for fixing this!

--
Loïc Minier

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'README'
--- README 2011-07-28 10:48:11 +0000
+++ README 2011-11-21 13:53:24 +0000
@@ -22,8 +22,8 @@
22Before running any tests you need to install the following packages:22Before running any tests you need to install the following packages:
2323
24 - testrepository24 - testrepository
25 - python-testtools >= 0.9.625 - python-testtools >= 0.9.8
26 (available at https://launchpad.net/~bzr/+archive/ppa)26 (available at https://launchpad.net/~linaro-maintainers/+archive/tools)
27 - python-debian >= 0.1.16ubuntu127 - python-debian >= 0.1.16ubuntu1
28 - python-argparse28 - python-argparse
29 - dpkg-dev29 - dpkg-dev
3030
=== modified file 'linaro_image_tools/tests/test_pyflakes.py'
--- linaro_image_tools/tests/test_pyflakes.py 2011-10-12 09:54:29 +0000
+++ linaro_image_tools/tests/test_pyflakes.py 2011-11-21 13:53:24 +0000
@@ -27,10 +27,6 @@
27 stdout=subprocess.PIPE,27 stdout=subprocess.PIPE,
28 stderr=subprocess.PIPE)28 stderr=subprocess.PIPE)
29 (stdout, stderr) = proc.communicate()29 (stdout, stderr) = proc.communicate()
30 stdout = stdout.splitlines()30 self.assertEquals('', stdout)
31 stdout.sort()
32 expected = ["./linaro_image_tools/utils.py:31: redefinition of "
33 "unused 'CommandNotFound' from line 29" ]
34 self.assertEquals(expected, stdout)
35 self.assertEquals('', stderr)31 self.assertEquals('', stderr)
3632
3733
=== modified file 'linaro_image_tools/utils.py'
--- linaro_image_tools/utils.py 2011-10-13 14:49:05 +0000
+++ linaro_image_tools/utils.py 2011-11-21 13:53:24 +0000
@@ -25,13 +25,12 @@
25import tempfile25import tempfile
26import tarfile26import tarfile
2727
28try:28from testtools import try_import
29 from CommandNotFound import CommandNotFound
30except ImportError:
31 CommandNotFound = None
3229
33from linaro_image_tools import cmd_runner30from linaro_image_tools import cmd_runner
3431
32CommandNotFound = try_import('CommandNotFound.CommandNotFound')
33
3534
36def path_in_tarfile_exists(path, tar_file):35def path_in_tarfile_exists(path, tar_file):
37 tarinfo = tarfile.open(tar_file, 'r:gz')36 tarinfo = tarfile.open(tar_file, 'r:gz')

Subscribers

People subscribed via source and target branches