Opened 8 years ago

Closed 5 years ago

#2367 defect closed fixed (fixed)

twisted.test.test_failure.FailureTestCase.testBrokenStr breaks trial in debug mode

Reported by: exarkun Owned by: fijal
Priority: high Milestone:
Component: trial Keywords:
Cc: jesstess Branch: branches/fix-broken-str-2376
(diff, github, buildbot, log)
Author: Launchpad Bug:

Description

exarkun@kunai:/tmp$ trial -b twisted.test.test_failure
Running 9 tests.
> /home/exarkun/Projects/Twisted/trunk/twisted/trial/runner.py(284)run()
-> try:
(Pdb) c
twisted.test.test_failure
  FailureTestCase
    testBrokenStr ... Traceback (most recent call last):
  File "/home/exarkun/Projects/Twisted/trunk/bin/trial", line 24, in ?
    run()
  File "/home/exarkun/Projects/Twisted/trunk/twisted/scripts/trial.py", line 345, in run
    test_result = trialRunner.run(suite)
  File "/home/exarkun/Projects/Twisted/trunk/twisted/trial/runner.py", line 787, in run
    debugger.runcall(suite.run, result)
  File "/usr/lib/python2.4/bdb.py", line 404, in runcall
    res = func(*args, **kwds)
  File "/home/exarkun/Projects/Twisted/trunk/twisted/trial/runner.py", line 285, in run
    TestSuite.run(self, result)
  File "/home/exarkun/Projects/Twisted/trunk/twisted/trial/runner.py", line 149, in run
    test(result)
  File "/home/exarkun/Projects/Twisted/trunk/twisted/trial/runner.py", line 138, in __call__
    return self.run(result)
  File "/home/exarkun/Projects/Twisted/trunk/twisted/trial/runner.py", line 176, in run
    super(LoggedSuite, self).run(result)
  File "/home/exarkun/Projects/Twisted/trunk/twisted/trial/runner.py", line 149, in run
    test(result)
  File "/home/exarkun/Projects/Twisted/trunk/twisted/trial/runner.py", line 138, in __call__
    return self.run(result)
  File "/home/exarkun/Projects/Twisted/trunk/twisted/trial/runner.py", line 149, in run
    test(result)
  File "/home/exarkun/Projects/Twisted/trunk/twisted/trial/runner.py", line 138, in __call__
    return self.run(result)
  File "/home/exarkun/Projects/Twisted/trunk/twisted/trial/runner.py", line 149, in run
    test(result)
  File "/home/exarkun/Projects/Twisted/trunk/twisted/trial/runner.py", line 138, in __call__
    return self.run(result)
  File "/home/exarkun/Projects/Twisted/trunk/twisted/trial/runner.py", line 149, in run
    test(result)
  File "/home/exarkun/Projects/Twisted/trunk/twisted/trial/unittest.py", line 537, in __call__
    return self.run(*args, **kwargs)
  File "/home/exarkun/Projects/Twisted/trunk/twisted/trial/unittest.py", line 761, in run
    d = self.deferSetUp(None, result)
  File "/home/exarkun/Projects/Twisted/trunk/twisted/trial/unittest.py", line 566, in deferSetUp
    errbackArgs=(result,))
  File "/home/exarkun/Projects/Twisted/trunk/twisted/internet/defer.py", line 182, in addCallbacks
    self._runCallbacks()
  File "/home/exarkun/Projects/Twisted/trunk/twisted/internet/defer.py", line 331, in _runCallbacks
    self.result = failure.Failure()
  File "/home/exarkun/Projects/Twisted/trunk/twisted/python/failure.py", line 382, in _debuginit
    print "Jumping into debugger for post-mortem of exception '%s':" % exc[1]
  File "/home/exarkun/Projects/Twisted/trunk/twisted/test/test_failure.py", line 23, in __str__
    raise self
twisted.test.test_failure.BrokenStrexarkun@kunai:/tmp$ 

Change History (5)

comment:1 Changed 5 years ago by fijal

  • Keywords review added
  • Owner jml deleted

comment:2 Changed 5 years ago by fijal

  • Branch set to branches/fix-broken-str-2376

comment:3 Changed 5 years ago by jesstess

  • Owner set to jesstess

comment:4 Changed 5 years ago by jesstess

  • Cc jesstess added
  • Keywords review removed
  • Owner changed from jesstess to fijal

Thanks for the branch, fijal. A few comments:

  • twisted/python/failure.py needs a copyright bump
  • needs a NEWS file
  • even though _debuginit is private, there's a lot going on and it'd benefit from a docstring.

Relatedly, it looks like twisted.test.test_failure.FailureTestCase.testConstructionFails fails in debug mode with exceptions.ValueError: A valid traceback must be passed if no exception is being handled, which possibly needs its own ticket.

comment:5 Changed 5 years ago by fijal

  • Resolution set to fixed
  • Status changed from new to closed

Closing this, created 4302

Note: See TracTickets for help on using tickets.