~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_selftest.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-10-15 07:01:45 UTC
  • mfrom: (5495.1.1 trivial)
  • Revision ID: pqm@pqm.ubuntu.com-20101015070145-urfgyncl1z7zjovn
(spiv) Remove ForwardingResult,
 which has been obsoleted by testtools. (Andrew Bennetts)

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
import unittest
27
27
import warnings
28
28
 
29
 
from testtools import MultiTestResult
 
29
from testtools import (
 
30
    ExtendedToOriginalDecorator,
 
31
    MultiTestResult,
 
32
    )
30
33
from testtools.content import Content
31
34
from testtools.content_type import ContentType
32
35
from testtools.matchers import (
1119
1122
    def test_result_decorator(self):
1120
1123
        # decorate results
1121
1124
        calls = []
1122
 
        class LoggingDecorator(tests.ForwardingResult):
 
1125
        class LoggingDecorator(ExtendedToOriginalDecorator):
1123
1126
            def startTest(self, test):
1124
 
                tests.ForwardingResult.startTest(self, test)
 
1127
                ExtendedToOriginalDecorator.startTest(self, test)
1125
1128
                calls.append('start')
1126
1129
        test = unittest.FunctionTestCase(lambda:None)
1127
1130
        stream = StringIO()
1266
1269
    def test_startTestRun(self):
1267
1270
        """run should call result.startTestRun()"""
1268
1271
        calls = []
1269
 
        class LoggingDecorator(tests.ForwardingResult):
 
1272
        class LoggingDecorator(ExtendedToOriginalDecorator):
1270
1273
            def startTestRun(self):
1271
 
                tests.ForwardingResult.startTestRun(self)
 
1274
                ExtendedToOriginalDecorator.startTestRun(self)
1272
1275
                calls.append('startTestRun')
1273
1276
        test = unittest.FunctionTestCase(lambda:None)
1274
1277
        stream = StringIO()
1280
1283
    def test_stopTestRun(self):
1281
1284
        """run should call result.stopTestRun()"""
1282
1285
        calls = []
1283
 
        class LoggingDecorator(tests.ForwardingResult):
 
1286
        class LoggingDecorator(ExtendedToOriginalDecorator):
1284
1287
            def stopTestRun(self):
1285
 
                tests.ForwardingResult.stopTestRun(self)
 
1288
                ExtendedToOriginalDecorator.stopTestRun(self)
1286
1289
                calls.append('stopTestRun')
1287
1290
        test = unittest.FunctionTestCase(lambda:None)
1288
1291
        stream = StringIO()
2066
2069
            def __call__(test, result):
2067
2070
                test.run(result)
2068
2071
            def run(test, result):
2069
 
                self.assertIsInstance(result, tests.ForwardingResult)
 
2072
                self.assertIsInstance(result, ExtendedToOriginalDecorator)
2070
2073
                calls.append("called")
2071
2074
            def countTestCases(self):
2072
2075
                return 1