~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_selftest.py

  • Committer: Robert Collins
  • Date: 2006-05-16 05:16:22 UTC
  • mto: (1713.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 1714.
  • Revision ID: robertc@robertcollins.net-20060516051622-807a8bbda673f4ee
'bzr selftest --benchmark' will run a new benchmarking selftest.
(Robert Collins, Martin Pool).

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
"""Tests for the test framework."""
17
17
 
18
18
import os
 
19
from StringIO import StringIO
19
20
import sys
20
21
import unittest
21
22
import warnings
29
30
                          TestCaseInTempDir,
30
31
                          TestCaseWithTransport,
31
32
                          TestSkipped,
 
33
                          TestSuite,
32
34
                          TextTestRunner,
33
35
                          )
34
36
import bzrlib.errors as errors
551
553
                              bzrlib.bzrdir.BzrDirMetaFormat1)
552
554
        self.assertIsInstance(bzrlib.bzrdir.BzrDir.open('b')._format,
553
555
                              bzrlib.bzrdir.BzrDirFormat6)
 
556
 
 
557
 
 
558
class TestSelftest(TestCase):
 
559
    """Tests of bzrlib.tests.selftest."""
 
560
 
 
561
    def test_selftest_benchmark_parameter_invokes_test_suite__benchmark__(self):
 
562
        factory_called = []
 
563
        def factory():
 
564
            factory_called.append(True)
 
565
            return TestSuite()
 
566
        out = StringIO()
 
567
        err = StringIO()
 
568
        self.apply_redirected(out, err, None, bzrlib.tests.selftest, 
 
569
            test_suite_factory=factory)
 
570
        self.assertEqual([True], factory_called)