cmheisel/nose-xcover — Issue #11: more helpful message with TypeError exception
Author: rsyring
Created: 2011-10-19 23:45:42+00:00
State: open

I recently had two Jenkins builds fail. The output was:

+ nosetests authbwc_ta --blazeweb-package=authbwc_ta --with-coverage --cover-package=authbwc_ta,authbwc --with-xunit --with-xcoverage --cover-tests
nose.plugins.xcover: ERROR: You can not use both --with-xcover and --with-coverage. Using --with-xcover implies --with-coverage
Traceback (most recent call last):
File "/tmp/authbwc-jenkins-venv/bin/nosetests", line 8, in
load_entry_point('nose==1.1.2', 'console_scripts', 'nosetests')()
File "/tmp/authbwc-jenkins-venv/lib/python2.6/site-packages/nose/core.py", line 118, in __init__
**extra_args)
File "/usr/lib/python2.6/unittest.py", line 816, in __init__
self.parseArgs(argv)
File "/tmp/authbwc-jenkins-venv/lib/python2.6/site-packages/nose/core.py", line 135, in parseArgs
self.config.configure(argv, doc=self.usage())
File "/tmp/authbwc-jenkins-venv/lib/python2.6/site-packages/nose/config.py", line 338, in configure
self.plugins.configure(options, self)
File "/tmp/authbwc-jenkins-venv/lib/python2.6/site-packages/nose/plugins/manager.py", line 271, in configure
cfg(options, config)
File "/tmp/authbwc-jenkins-venv/lib/python2.6/site-packages/nose/plugins/manager.py", line 94, in __call__
return self.call(*arg, **kw)
File "/tmp/authbwc-jenkins-venv/lib/python2.6/site-packages/nose/plugins/manager.py", line 162, in simple
result = meth(*arg, **kw)
File "/tmp/authbwc-jenkins-venv/lib/python2.6/site-packages/nosexcover/nosexcover.py", line 36, in configure
raise TypeError
TypeError

Initially, it wasn't obvious to me why the build fails. I had to go look up the source code of nosexcover.py to figure it out. Once I did that, I realized the log message was above the exception. But, that was in the middle of a ton of Jenkins output, so it just didn't stand out.

I'd recommend putting the same message you have in the log message as the text for the exception.