Opened 9 years ago

Last modified 9 years ago

#4565 defect new

trial reporter dies on unexpected success

Reported by: acapnotic Owned by:
Priority: normal Milestone:
Component: trial Keywords:
Cc: Branch:


This explodes a bunch:

from twisted.trial import unittest

class TestThing(unittest.TestCase):
    def test_this(self):

    test_this.todo = (ValueError, "monkey")
  File "/usr/local/lib/python2.6/dist-packages/Twisted-10.0.0-py2.6-linux-i686.egg/twisted/trial/", line 884, in _runWithoutDecoration
  File "/usr/local/lib/python2.6/dist-packages/Twisted-10.0.0-py2.6-linux-i686.egg/twisted/trial/", line 636, in done
  File "/usr/local/lib/python2.6/dist-packages/Twisted-10.0.0-py2.6-linux-i686.egg/twisted/trial/", line 582, in _printErrors
  File "/usr/local/lib/python2.6/dist-packages/Twisted-10.0.0-py2.6-linux-i686.egg/twisted/trial/", line 545, in _printResults
  File "/usr/local/lib/python2.6/dist-packages/Twisted-10.0.0-py2.6-linux-i686.egg/twisted/trial/", line 556, in _printUnexpectedSuccess
    ret += 'Expected errors: %s\n' % (', '.join(todo.errors),)
TypeError: sequence item 0: expected string, type found

Change History (2)

comment:1 Changed 9 years ago by Jean-Paul Calderone

It's dying on the tuple, actually. The todo attribute is supposed to be a string. I remember there being some speculation about the use of being able to specify how such tests are expected to fail. Perhaps it was even implemented at some point. But it's not now.

I wonder if todo is documented anywhere. Oops, it seems to have some really terrible documentation in test-standard.xhtml that we should probably delete. Nothing there says anything about the value the attribute should have, though.

comment:2 Changed 8 years ago by <automation>

Owner: Jonathan Lange deleted
Note: See TracTickets for help on using tickets.