~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_selftest.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-03-06 06:48:25 UTC
  • mfrom: (4070.8.6 debug-config)
  • Revision ID: pqm@pqm.ubuntu.com-20090306064825-kbpwggw21dygeix6
(mbp) debug_flags configuration option

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
"""UI tests for the test framework."""
18
18
 
19
 
from cStringIO import StringIO
20
19
import os
21
20
import re
22
21
import signal
23
22
import sys
24
 
import unittest
25
23
 
26
24
import bzrlib
27
25
from bzrlib import (
29
27
    )
30
28
from bzrlib.errors import ParamikoNotPresent
31
29
from bzrlib.tests import (
32
 
                          SubUnitFeature,
33
30
                          TestCase,
34
31
                          TestCaseInTempDir,
35
32
                          TestCaseWithMemoryTransport,
91
88
            TestOptions.current_test = None
92
89
            TestCaseWithMemoryTransport.TEST_ROOT = old_root
93
90
 
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
 
 
109
91
 
110
92
class TestRunBzr(ExternalBase):
111
93