Ticket #2495 (closed defect: fixed )

Opened 2 years ago

Last modified 2 years ago

Trial never passes a traceback to pyunit-API TestResult objects

Reported by: jml Assigned to: jml
Type: defect Priority: highest
Milestone: Component: trial
Keywords: Cc: itamarst
Branch: Author:
Launchpad Bug:

Description

If one is using the pyunit.TestResult object, or the zope testrunnner TestResult object, one never, ever receives a traceback from Trial TestCases.

Extremely frustrating bug.

Attachments

Change History

  2007-02-28 08:19:49+00:00 changed by jml

  • keywords set to review
  • owner changed from jml to spiv
  • priority changed from high to highest

Ready for review in pyresult-tb-2495.

  2007-03-01 02:15:11+00:00 changed by jml

  • keywords deleted
  • owner changed from spiv to jml
  • priority changed from highest to high

Taking down from review and adding traceback simulation feature.

  2007-03-01 06:11:07+00:00 changed by jml

  • keywords set to review
  • owner changed from jml to spiv
  • priority changed from high to highest

Ready for review in same branch.

  2007-03-01 13:59:04+00:00 changed by itamarst

  • cc set to itamarst

What is the relation of this branch re the fixes proposed for #2466?

  2007-03-01 21:51:09+00:00 changed by jml

This branch makes no changes to the handling of locals or globals. The only new attribute it introduces is a method.

Changing the handling of locals or globals probably wouldn't affect the branch.

  2007-03-05 01:47:58+00:00 changed by exarkun

  • keywords deleted
  • owner changed from spiv to jml

FormattableTraceback?, Code, and Frame are missing docstrings and attribute documentation. I'm not sure FormattableTraceback makes a lot of sense (if it does, why not FormattableCode and FormattableFrame?)

getFormattableTraceback's docstring is misformated. I'm also not sure what it's behavior in the case of Failure(Exception("foo")) is meant to be.

In test_getFormattableTraceback, assertEqual should be assertIdentical, shouldn't it be?

TestFormattableTraceback? is missing docstrings.

ErrorTest defined in test_traceback gratuitously uses s instead of self.

Also, should the todo on test_traceback be there? The test passes, and so does the referenced precondition.

  2007-03-06 08:42:41+00:00 changed by jml

  • status changed from new to closed
  • resolution set to fixed

(In [19771]) Useful tracebacks when running Trial tests against pyunit TestResults

  • Author: jml
  • Reviewer: exarkun
  • Fixes #2495

Adds a new method getTracebackObject to Failure, which always returns an object that can be passed to traceback.extract_tb and includes all the information the Failure has on the relevant stack trace.

Uses this new method to provide sys.exc_info-like information to pyunit TestResult objects via PyUnitResultAdapter.

Note: See TracTickets for help on using tickets.