/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_selftest.py

  • Committer: Robert Collins
  • Date: 2009-08-26 23:25:28 UTC
  • mto: This revision was merged to the branch mainline in revision 4659.
  • Revision ID: robertc@robertcollins.net-20090826232528-sld5o6xa1afm08y8
Push all starting up reporting down into startTestRun.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1294
1294
        self.assertContainsRe(log, 'this will be kept')
1295
1295
        self.assertEqual(log, test._log_contents)
1296
1296
 
 
1297
    def test_startTestRun(self):
 
1298
        """run should call result.startTestRun()"""
 
1299
        calls = []
 
1300
        class LoggingDecorator(tests.ForwardingResult):
 
1301
            def startTestRun(self):
 
1302
                tests.ForwardingResult.startTestRun(self)
 
1303
                calls.append('startTestRun')
 
1304
        test = unittest.FunctionTestCase(lambda:None)
 
1305
        stream = StringIO()
 
1306
        runner = tests.TextTestRunner(stream=stream,
 
1307
            result_decorators=[LoggingDecorator])
 
1308
        result = self.run_test_runner(runner, test)
 
1309
        self.assertLength(1, calls)
 
1310
 
1297
1311
    def test_stopTestRun(self):
1298
1312
        """run should call result.stopTestRun()"""
1299
1313
        calls = []