/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/blackbox/test_selftest.py

  • Committer: Martin Pool
  • Date: 2009-03-23 07:25:27 UTC
  • mfrom: (4183 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4189.
  • Revision ID: mbp@sourcefrog.net-20090323072527-317my4n8zej1g6v9
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""UI tests for the test framework."""
18
18
 
 
19
from cStringIO import StringIO
19
20
import os
20
21
import re
21
22
import signal
22
23
import sys
 
24
import unittest
23
25
 
24
26
import bzrlib
25
27
from bzrlib import (
27
29
    )
28
30
from bzrlib.errors import ParamikoNotPresent
29
31
from bzrlib.tests import (
 
32
                          SubUnitFeature,
30
33
                          TestCase,
31
34
                          TestCaseInTempDir,
32
35
                          TestCaseWithMemoryTransport,
88
91
            TestOptions.current_test = None
89
92
            TestCaseWithMemoryTransport.TEST_ROOT = old_root
90
93
 
 
94
    def test_subunit(self):
 
95
        """Passing --subunit results in subunit output."""
 
96
        self.requireFeature(SubUnitFeature)
 
97
        from subunit import ProtocolTestCase
 
98
        stdout = self.run_bzr(
 
99
            'selftest --subunit --no-plugins '
 
100
            'tests.test_selftest.SelftestTests.test_import_tests')[0]
 
101
        stream = StringIO(str(stdout))
 
102
        test = ProtocolTestCase(stream)
 
103
        result = unittest.TestResult()
 
104
        test.run(result)
 
105
        # 1 to deal with the 'test:' noise at the start, and 1 for the one we
 
106
        # ran.
 
107
        self.assertEqual(2, result.testsRun)
 
108
 
91
109
 
92
110
class TestRunBzr(ExternalBase):
93
111