~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_selftest.py

  • Committer: Andrew Bennetts
  • Date: 2007-04-20 03:00:57 UTC
  • mfrom: (2432 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2435.
  • Revision ID: andrew.bennetts@canonical.com-20070420030057-cg0z7spio1stbtpo
Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
756
756
        result.report_known_failure(test, err)
757
757
        output = result_stream.getvalue()[prefix:]
758
758
        lines = output.splitlines()
759
 
        self.assertEqual(lines, ['XFAIL                   0ms', '    foo'])
760
 
    
 
759
        self.assertContainsRe(lines[0], r'XFAIL *\d+ms$')
 
760
        self.assertEqual(lines[1], '    foo')
 
761
        self.assertEqual(2, len(lines))
 
762
 
761
763
    def test_text_report_known_failure(self):
762
764
        # text test output formatting
763
765
        pb = MockProgress()
950
952
        stream = StringIO()
951
953
        runner = TextTestRunner(stream=stream)
952
954
        result = self.run_test_runner(runner, test)
953
 
        self.assertEqual(
954
 
            '\n'
955
 
            '----------------------------------------------------------------------\n'
956
 
            'Ran 1 test in 0.000s\n'
957
 
            '\n'
958
 
            'OK (known_failures=1)\n',
959
 
            stream.getvalue())
 
955
        self.assertContainsRe(stream.getvalue(),
 
956
            '\n'
 
957
            '-*\n'
 
958
            'Ran 1 test in .*\n'
 
959
            '\n'
 
960
            'OK \\(known_failures=1\\)\n')
960
961
 
961
962
    def test_skipped_test(self):
962
963
        # run a test that is skipped, and check the suite as a whole still