errors importing commands are obfuscated

Bug #685360 reported by Jelmer Vernooij
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Testrepository
Triaged
Wishlist
Unassigned

Bug Description

  affects testrepository

When running testrepository without python-fixtures installed I get a
strange error:

$ testr run
Traceback (most recent call last):
  File "/usr/bin/testr", line 26, in <module>
    sys.exit(run_argv(sys.argv, sys.stdin, sys.stdout, sys.stderr))
  File
"/usr/lib/python2.6/dist-packages/testrepository/commands/__init__.py",
line 178, in run_argv
    cmdclass = _find_command(cmd_name)
  File
"/usr/lib/python2.6/dist-packages/testrepository/commands/__init__.py",
line 49, in _find_command
    raise KeyError("Could not import command module %s" % modname)
KeyError: 'Could not import command module testrepository.commands.run'

Commenting out the exception handling I get:

Traceback (most recent call last):
  File "/usr/bin/testr", line 26, in <module>
    sys.exit(run_argv(sys.argv, sys.stdin, sys.stdout, sys.stderr))
  File
"/usr/lib/python2.6/dist-packages/testrepository/commands/__init__.py",
line 175, in run_argv
    cmdclass = _find_command(cmd_name)
  File
"/usr/lib/python2.6/dist-packages/testrepository/commands/__init__.py",
line 46, in _find_command
    _temp = __import__(modname, globals(), locals(), [classname])
  File
"/usr/lib/python2.6/dist-packages/testrepository/commands/run.py", line
27, in <module>
    from testrepository.testcommand import TestCommand, testrconf_help
  File "/usr/lib/python2.6/dist-packages/testrepository/testcommand.py",
line 18, in <module>
    from fixtures import Fixture
ImportError: No module named fixtures

It'd be nice if testrepository could give a saner error when fixtures
was missing.

Changed in testrepository:
status: New → Triaged
importance: Undecided → Wishlist
summary: - clearer error when fixtures is missing
+ exception reporting is so brief problems cannot be diagnosed easily.
Revision history for this message
Robert Collins (lifeless) wrote : Re: exception reporting is so brief problems cannot be diagnosed easily.

You can set TESTR_PDB=1 to diagnose this.

summary: - exception reporting is so brief problems cannot be diagnosed easily.
+ errors importing commands are obfuscated
Revision history for this message
Patrick Crews (patrick-crews) wrote :

Can confirm that the workaround does not work, code that would use this isn't hit until after the exception is encountered, no extra data is generated by setting the variable

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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