~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: 2009-08-15 09:15:03 UTC
  • mfrom: (4595.7.4 409137-lsb-release)
  • Revision ID: pqm@pqm.ubuntu.com-20090815091503-qwbm6glvv31rnujw
(mbp) show platform in selftest, version and backtrace

Show diffs side-by-side

added added

removed removed

Lines of Context:
998
998
        runner = tests.TextTestRunner(stream=stream)
999
999
        result = self.run_test_runner(runner, test)
1000
1000
        lines = stream.getvalue().splitlines()
1001
 
        self.assertEqual([
1002
 
            '',
1003
 
            '======================================================================',
1004
 
            'FAIL: unittest.FunctionTestCase (failing_test)',
1005
 
            '----------------------------------------------------------------------',
1006
 
            'Traceback (most recent call last):',
1007
 
            '    raise AssertionError(\'foo\')',
1008
 
            'AssertionError: foo',
1009
 
            '',
1010
 
            '----------------------------------------------------------------------',
1011
 
            '',
1012
 
            'FAILED (failures=1, known_failure_count=1)'],
1013
 
            lines[3:8] + lines[9:13] + lines[14:])
 
1001
        self.assertContainsRe(stream.getvalue(),
 
1002
            '(?sm)^testing.*$'
 
1003
            '.*'
 
1004
            '^======================================================================\n'
 
1005
            '^FAIL: unittest.FunctionTestCase \\(failing_test\\)\n'
 
1006
            '^----------------------------------------------------------------------\n'
 
1007
            'Traceback \\(most recent call last\\):\n'
 
1008
            '  .*' # File .*, line .*, in failing_test' - but maybe not from .pyc
 
1009
            '    raise AssertionError\\(\'foo\'\\)\n'
 
1010
            '.*'
 
1011
            '^----------------------------------------------------------------------\n'
 
1012
            '.*'
 
1013
            'FAILED \\(failures=1, known_failure_count=1\\)'
 
1014
            )
1014
1015
 
1015
1016
    def test_known_failure_ok_run(self):
1016
1017
        # run a test that generates a known failure which should be printed in the final output.