Improve diagnostics in self-test

Bug #1303550 reported by Daniel Macks
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-distutils-extra (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

p-d-e-2.38 test/auto.py failed a test for me:

======================================================================
FAIL: test_requires_provides (__main__.T)
automatic requires/provides
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/auto.py", line 678, in test_requires_provides
    self.fail('You need to have pkg_resources, httplib2, and gi.repository.GLib installed for this test suite to work')
AssertionError: You need to have pkg_resources, httplib2, and gi.repository.GLib installed for this test suite to work

----------------------------------------------------------------------

There's no info about which part of the multiprong requirement failed. Instead of a single "try" for multiple imports, a loop over them would make it easy to emit the specific package that failed. Wit the attached patch, I get:

======================================================================
FAIL: test_requires_provides (__main__.T)
automatic requires/provides
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/auto.py", line 677, in test_requires_provides
    self.fail('You need to have %s installed for this test suite to work' % needed_pkg)
AssertionError: You need to have gi.repository.GLib installed for this test suite to work

----------------------------------------------------------------------

So now I know exactly which dep is missing (or if I think I have it, which is broken).

Tags: patch

Related branches

Revision history for this message
Daniel Macks (dmacks-netspace) wrote :
Revision history for this message
Martin Pitt (pitti) wrote :

Applied, thank you!

affects: python-distutils-extra → python-distutils-extra (Ubuntu)
Changed in python-distutils-extra (Ubuntu):
status: New → Fix Committed
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "loop-try-import.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-distutils-extra - 2.39-1

---------------
python-distutils-extra (2.39-1) unstable; urgency=medium

  * test/auto.py: Show exactly which modules are missing. Thanks Daniel Macks!
    (LP: #1303550)
  * Ignore comment in second line when parsing *.ui files. Thanks marmuta!
    (LP: #1393247)
  * Drop obsolete X-Python-Version.
  * Convert build systemd to pybuild.
  * Bump Standards-Version to 3.9.6.
  * debian/copyright: Rename field to "Format:".

 -- Martin Pitt <email address hidden> Wed, 03 Feb 2016 09:56:55 +0100

Changed in python-distutils-extra (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.