← Back to team overview

linaro-release team mailing list archive

[Bug 892391] [NEW] Fix test_pyflakes when ran as part of a package build

 

Public bug reported:

Maybe we can use testtools.try_import() to get rid of this warning and
make test_pyflakes more robust? Might need to require a recent enough
version of testtools and copy it to our ppa (for Lucid) if that's the
case.

======================================================================
FAIL: linaro_image_tools.tests.test_pyflakes.TestPyflakes.test_pyflakes
----------------------------------------------------------------------
Text attachment: traceback
------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/testtools/runtest.py", line 169, in _run_user
    return fn(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/testtools/testcase.py", line 540, in _run_test_method
    return self._get_test_method()()
  File "linaro_image_tools/tests/test_pyflakes.py", line 34, in test_pyflakes
    self.assertEquals(expected, stdout)
  File "/usr/lib/python2.7/dist-packages/testtools/testcase.py", line 310, in assertEqual
    self.assertThat(observed, matcher)
  File "/usr/lib/python2.7/dist-packages/testtools/testcase.py", line 386, in assertThat
    % (matchee, matcher, mismatch.describe()))
AssertionError: Match failed. Matchee: "["./build/lib.linux-x86_64-2.6/linaro_image_tools/utils.py:31: redefinition of unused 'CommandNotFound' from line 29", "./build/lib.linux-x86_64-2.7/linaro_image_tools/utils.py:31: redefinition of unused 'CommandNotFound' from line 29", "./linaro_image_tools/utils.py:31: redefinition of unused 'CommandNotFound' from line 29"]"
Matcher: Equals(["./linaro_image_tools/utils.py:31: redefinition of unused 'CommandNotFound' from line 29"])
Difference: !=:
reference = ["./linaro_image_tools/utils.py:31: redefinition of unused 'CommandNotFound' from line 29"]
actual = ["./build/lib.linux-x86_64-2.6/linaro_image_tools/utils.py:31: redefinition of unused 'CommandNotFound' from line 29",
 "./build/lib.linux-x86_64-2.7/linaro_image_tools/utils.py:31: redefinition of unused 'CommandNotFound' from line 29",
 "./linaro_image_tools/utils.py:31: redefinition of unused 'CommandNotFound' from line 29"]

** Affects: linaro-image-tools
     Importance: High
         Status: Triaged

** Changed in: linaro-image-tools
       Status: New => Triaged

** Changed in: linaro-image-tools
   Importance: Undecided => High

-- 
You received this bug notification because you are a member of linaro-
infrastructure-drivers, which is the registrant for Linaro Image Tools.
https://bugs.launchpad.net/bugs/892391

Title:
  Fix test_pyflakes when ran as part of a package build

Status in Linaro Image Tools:
  Triaged

Bug description:
  Maybe we can use testtools.try_import() to get rid of this warning and
  make test_pyflakes more robust? Might need to require a recent enough
  version of testtools and copy it to our ppa (for Lucid) if that's the
  case.

  ======================================================================
  FAIL: linaro_image_tools.tests.test_pyflakes.TestPyflakes.test_pyflakes
  ----------------------------------------------------------------------
  Text attachment: traceback
  ------------
  Traceback (most recent call last):
    File "/usr/lib/python2.7/dist-packages/testtools/runtest.py", line 169, in _run_user
      return fn(*args, **kwargs)
    File "/usr/lib/python2.7/dist-packages/testtools/testcase.py", line 540, in _run_test_method
      return self._get_test_method()()
    File "linaro_image_tools/tests/test_pyflakes.py", line 34, in test_pyflakes
      self.assertEquals(expected, stdout)
    File "/usr/lib/python2.7/dist-packages/testtools/testcase.py", line 310, in assertEqual
      self.assertThat(observed, matcher)
    File "/usr/lib/python2.7/dist-packages/testtools/testcase.py", line 386, in assertThat
      % (matchee, matcher, mismatch.describe()))
  AssertionError: Match failed. Matchee: "["./build/lib.linux-x86_64-2.6/linaro_image_tools/utils.py:31: redefinition of unused 'CommandNotFound' from line 29", "./build/lib.linux-x86_64-2.7/linaro_image_tools/utils.py:31: redefinition of unused 'CommandNotFound' from line 29", "./linaro_image_tools/utils.py:31: redefinition of unused 'CommandNotFound' from line 29"]"
  Matcher: Equals(["./linaro_image_tools/utils.py:31: redefinition of unused 'CommandNotFound' from line 29"])
  Difference: !=:
  reference = ["./linaro_image_tools/utils.py:31: redefinition of unused 'CommandNotFound' from line 29"]
  actual = ["./build/lib.linux-x86_64-2.6/linaro_image_tools/utils.py:31: redefinition of unused 'CommandNotFound' from line 29",
   "./build/lib.linux-x86_64-2.7/linaro_image_tools/utils.py:31: redefinition of unused 'CommandNotFound' from line 29",
   "./linaro_image_tools/utils.py:31: redefinition of unused 'CommandNotFound' from line 29"]

To manage notifications about this bug go to:
https://bugs.launchpad.net/linaro-image-tools/+bug/892391/+subscriptions


Follow ups

References