Ticket #4565 defect new

Opened 4 years ago

Last modified 4 years ago

trial reporter dies on unexpected success

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

Description

This explodes a bunch:

from twisted.trial import unittest

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

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

Change History

1

Changed 4 years ago by exarkun

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.

2

Changed 3 years ago by <automation>

  • owner jml deleted
Note: See TracTickets for help on using tickets.