~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_selftest.py

(jameinel) Handle [:digit:] globbing tests better for python2.7 (Martin [gz])

Show diffs side-by-side

added added

removed removed

Lines of Context:
801
801
        self.requireFeature(test_lsprof.LSProfFeature)
802
802
        result_stream = StringIO()
803
803
        result = bzrlib.tests.VerboseTestResult(
804
 
            unittest._WritelnDecorator(result_stream),
 
804
            result_stream,
805
805
            descriptions=0,
806
806
            verbosity=2,
807
807
            )
862
862
        # verbose test output formatting
863
863
        result_stream = StringIO()
864
864
        result = bzrlib.tests.VerboseTestResult(
865
 
            unittest._WritelnDecorator(result_stream),
 
865
            result_stream,
866
866
            descriptions=0,
867
867
            verbosity=2,
868
868
            )
878
878
        output = result_stream.getvalue()[prefix:]
879
879
        lines = output.splitlines()
880
880
        self.assertContainsRe(lines[0], r'XFAIL *\d+ms$')
 
881
        if sys.version_info > (2, 7):
 
882
            self.expectFailure("_ExpectedFailure on 2.7 loses the message",
 
883
                self.assertNotEqual, lines[1], '    ')
881
884
        self.assertEqual(lines[1], '    foo')
882
885
        self.assertEqual(2, len(lines))
883
886
 
917
920
        # verbose test output formatting
918
921
        result_stream = StringIO()
919
922
        result = bzrlib.tests.VerboseTestResult(
920
 
            unittest._WritelnDecorator(result_stream),
 
923
            result_stream,
921
924
            descriptions=0,
922
925
            verbosity=2,
923
926
            )
1419
1422
        sample_test = TestTestCase("method_that_times_a_bit_twice")
1420
1423
        output_stream = StringIO()
1421
1424
        result = bzrlib.tests.VerboseTestResult(
1422
 
            unittest._WritelnDecorator(output_stream),
 
1425
            output_stream,
1423
1426
            descriptions=0,
1424
1427
            verbosity=2)
1425
1428
        sample_test.run(result)