~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_selftest.py

(gz) Make test unexpected successes count as failures (Martin [gz])

Show diffs side-by-side

added added

removed removed

Lines of Context:
1083
1083
            '\n'
1084
1084
            'OK \\(known_failures=1\\)\n')
1085
1085
 
 
1086
    def test_unexpected_success_bad(self):
 
1087
        class Test(tests.TestCase):
 
1088
            def test_truth(self):
 
1089
                self.expectFailure("No absolute truth", self.assertTrue, True)
 
1090
        runner = tests.TextTestRunner(stream=StringIO())
 
1091
        result = self.run_test_runner(runner, Test("test_truth"))
 
1092
        self.assertContainsRe(runner.stream.getvalue(),
 
1093
            "=+\n"
 
1094
            "FAIL: \\S+\.test_truth\n"
 
1095
            "-+\n"
 
1096
            "(?:.*\n)*"
 
1097
            "No absolute truth\n"
 
1098
            "(?:.*\n)*"
 
1099
            "-+\n"
 
1100
            "Ran 1 test in .*\n"
 
1101
            "\n"
 
1102
            "FAILED \\(failures=1\\)\n\\Z")
 
1103
 
1086
1104
    def test_result_decorator(self):
1087
1105
        # decorate results
1088
1106
        calls = []