From patchwork Mon Nov 21 14:17:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Guilherme Salgado X-Patchwork-Id: 5234 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 9E8F923E10 for ; Mon, 21 Nov 2011 14:17:22 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id 6CBC7A18394 for ; Mon, 21 Nov 2011 14:17:22 +0000 (UTC) Received: by ywb5 with SMTP id 5so6568853ywb.11 for ; Mon, 21 Nov 2011 06:17:21 -0800 (PST) Received: by 10.152.105.226 with SMTP id gp2mr8999018lab.28.1321885041278; Mon, 21 Nov 2011 06:17:21 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.41.198 with SMTP id h6cs119451lal; Mon, 21 Nov 2011 06:17:20 -0800 (PST) Received: by 10.180.107.229 with SMTP id hf5mr14092828wib.35.1321885039445; Mon, 21 Nov 2011 06:17:19 -0800 (PST) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id s7si4857032wiw.14.2011.11.21.06.17.19 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 21 Nov 2011 06:17:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1RSUgQ-0003a8-Pg for ; Mon, 21 Nov 2011 14:17:18 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id B94AFE0444 for ; Mon, 21 Nov 2011 14:17:18 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: linaro-image-tools X-Launchpad-Branch: ~linaro-image-tools/linaro-image-tools/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 465 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-image-tools/linaro-image-tools/trunk] Rev 465: Use testtools.try_import for CommandNotFound; that way our pyflakes test can expect a clean output Message-Id: <20111121141718.20939.17550.launchpad@ackee.canonical.com> Date: Mon, 21 Nov 2011 14:17:18 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="14299"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 5706bb238daf33acbe816b1ab01055b27f991001 Merge authors: Guilherme Salgado (salgado) Related merge proposals: https://code.launchpad.net/~salgado/linaro-image-tools/bug-892391/+merge/82883 proposed by: Guilherme Salgado (salgado) review: Approve - Loïc Minier (lool) ------------------------------------------------------------ revno: 465 [merge] committer: Guilherme Salgado branch nick: trunk timestamp: Mon 2011-11-21 11:15:32 -0300 message: Use testtools.try_import for CommandNotFound; that way our pyflakes test can expect a clean output modified: README linaro_image_tools/tests/test_pyflakes.py linaro_image_tools/utils.py --- lp:linaro-image-tools https://code.launchpad.net/~linaro-image-tools/linaro-image-tools/trunk You are subscribed to branch lp:linaro-image-tools. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-image-tools/linaro-image-tools/trunk/+edit-subscription === modified file 'README' --- README 2011-07-28 10:48:11 +0000 +++ README 2011-11-21 13:48:20 +0000 @@ -22,8 +22,8 @@ Before running any tests you need to install the following packages: - testrepository - - python-testtools >= 0.9.6 - (available at https://launchpad.net/~bzr/+archive/ppa) + - python-testtools >= 0.9.8 + (available at https://launchpad.net/~linaro-maintainers/+archive/tools) - python-debian >= 0.1.16ubuntu1 - python-argparse - dpkg-dev === 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:48:20 +0000 @@ -27,10 +27,6 @@ stdout=subprocess.PIPE, stderr=subprocess.PIPE) (stdout, stderr) = proc.communicate() - stdout = stdout.splitlines() - stdout.sort() - expected = ["./linaro_image_tools/utils.py:31: redefinition of " - "unused 'CommandNotFound' from line 29" ] - self.assertEquals(expected, stdout) + self.assertEquals('', stdout) self.assertEquals('', stderr) === 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:48:20 +0000 @@ -25,13 +25,12 @@ import tempfile import tarfile -try: - from CommandNotFound import CommandNotFound -except ImportError: - CommandNotFound = None +from testtools import try_import from linaro_image_tools import cmd_runner +CommandNotFound = try_import('CommandNotFound.CommandNotFound') + def path_in_tarfile_exists(path, tar_file): tarinfo = tarfile.open(tar_file, 'r:gz')