Opened 15 years ago

Closed 12 years ago

#2428 defect closed wontfix (wontfix)

TestCase.setUpClass and TestCase.flushLoggedErrors conflict

Reported by: Jean-Paul Calderone Owned by:
Priority: normal Milestone:
Component: trial Keywords:
Cc: Branch:
Author:

Description

Demonstration:

from twisted.trial.unittest import TestCase

class XTests(TestCase):
    def setUpClass(self):
        pass

    def test_x(self):
        self.flushLoggedErrors()


    def test_y(self):
        self.flushLoggedErrors()

Results in this output:

Running 2 tests.
test_foo
  XTests
    test_x ...                                                          [ERROR]
    test_y ...                                                             [OK]

===============================================================================
[ERROR]: test_foo.XTests.test_x

Traceback (most recent call last):
  File "/home/exarkun/test_foo.py", line 9, in test_x
    self.flushLoggedErrors()
  File "/home/exarkun/Projects/Twisted/branches/ctrl+\\\\-2371+2123-2/twisted/trial/unittest.py", line 717, in flushLoggedErrors
    return self._observer.flushErrors(*errorTypes)
exceptions.AttributeError: 'XTests' object has no attribute '_observer'
-------------------------------------------------------------------------------
Ran 2 tests in 0.010s

Change History (3)

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

This is probably related to #1870

comment:2 Changed 12 years ago by Jean-Paul Calderone

Resolution: wontfix
Status: newclosed

We've dropped support for setUpClass.

comment:3 Changed 11 years ago by <automation>

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