/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_selftest.py

  • Committer: Marius Kruger
  • Date: 2010-08-15 04:52:51 UTC
  • mfrom: (5376 +trunk)
  • mto: (5384.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5385.
  • Revision ID: marius.kruger@enerweb.co.za-20100815045251-izmea8nn05thhrok
merge with bzr.dev

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)
2337
2340
            os.chdir = orig_chdir
2338
2341
        self.assertEqual(['foo', 'current'], chdirs)
2339
2342
 
 
2343
    def test_get_bzr_path_with_cwd_bzrlib(self):
 
2344
        self.get_source_path = lambda: ""
 
2345
        self.overrideAttr(os.path, "isfile", lambda path: True)
 
2346
        self.assertEqual(self.get_bzr_path(), "bzr")
 
2347
 
2340
2348
 
2341
2349
class TestActuallyStartBzrSubprocess(tests.TestCaseWithTransport):
2342
2350
    """Tests that really need to do things with an external bzr."""