Package: nti.nose_traceback_info
nose_traceback_infoHave you ever wanted supplemental (debugging) info included in an
error or failure traceback produced bynose? Do you find that
nose’sFailure Detailplugin fails you (for example, because you
usePyHamcrestmatchers)? Developing server software using Zope,
Plone, Paste orWebError? Then this plugin might be the solution
you’re looking for: it allows you to add whatever detailed information
you want to any frame in your traceback. Turn a traceback like this:Traceback (most recent call last):
File "/.../nti.nose_traceback_info/src/nti/nose_traceback_info/tests/test_nose_traceback_info.py", line 39, in test_format_failure
  t, formatted, _ = self.plugin.formatFailure(None, exc_info)
File "/.../nti.nose_traceback_info/src/nti/nose_traceback_info/__init__.py", line 48, in formatFailure
  return self.formatError( test, exc_info)
File "/.../nti.nose_traceback_info/src/nti/nose_traceback_info/__init__.py", line 31, in formatError
  t, v, tb = exc_info
TypeError: 'builtin_function_or_method' object is not iterableinto a traceback like this:TypeError: Traceback (most recent call last):
Module unittest.case, line 331, in run
  testMethod()
Module nti.nose_traceback_info.tests.test_nose_traceback_info, line 39, in test_format_failure
  t, formatted, _ = self.plugin.formatFailure(None, exc_info)
  - __traceback_info__: ("calling plugin with test and exc_info", None, <build-in function exc_info>)
Module nti.nose_traceback_info, line 48, in formatFailure
  return self.formatError( test, exc_info)
Module nti.nose_traceback_info, line 31, in formatError
  t, v, tb = exc_info
  - __traceback_info__: ("Test and exc_info args", None, <built-in function exc_info>)
TypeError: 'builtin_function_or_method' object is not iterableUsageOnce the plugin is installed (usingpipor in asetup.pyorrequirements.txtfile), it is enabled by default, just likelogcapture.The plugin operates by looking for local variables in
each frame in a traceback and formatting them (both in captured logs
and tracebacks displayed for failured tests). The variables are
defined by conventions developed (and documented) byZope; these
conventions are also followed byPasteandWebError, meaning
that information added to help debug tests can also be used to debug
production errors.See that documentation for details on the variables. As a quick start,
the most important and most commonly used variable is__traceback_info__, to which you can assign arbitrary information.
Thereprof__traceback_info__is included in the traceback:def formatError(self, test, exc_info):
    __traceback_info__ = "Test and exc_info args", test, exc_info
    t, v, tb = exc_infoOptionsIn addition to the standard environment variable and flags to enable
the plugin, additional options control some behaviour.--traceback-long-filenamesUse complete filenames, not module names, in formatted
tracebacks.--traceback-nologcaptureDo not format tracebacks captured in logs.Other PluginsThis plugin is known to cooperate correctly withnose-progressive,
which also adjusts the traceback.Changes1.0.2 (2015-04-21)Add support for PyPy, Python 3.4 and Python 3.2.1.0.1 (2013-12-14)By default, show filenames instead of module names.
This cooperates better with IDE test integration.1.0.0 (2013-09-27)Initial release