/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/__init__.py

  • Committer: Jelmer Vernooij
  • Date: 2009-03-20 22:29:04 UTC
  • mfrom: (4178 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4212.
  • Revision ID: jelmer@samba.org-20090320222904-nt65sw3stzxdd33b
merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2960
2960
                   'bzrlib.tests.test_extract',
2961
2961
                   'bzrlib.tests.test_fetch',
2962
2962
                   'bzrlib.tests.test_fifo_cache',
 
2963
                   'bzrlib.tests.test_filters',
2963
2964
                   'bzrlib.tests.test_ftp_transport',
2964
2965
                   'bzrlib.tests.test_foreign',
2965
2966
                   'bzrlib.tests.test_generate_docs',
3526
3527
        return 'case-insensitive filesystem'
3527
3528
 
3528
3529
CaseInsensitiveFilesystemFeature = _CaseInsensitiveFilesystemFeature()
 
3530
 
 
3531
 
 
3532
class _SubUnitFeature(Feature):
 
3533
    """Check if subunit is available."""
 
3534
 
 
3535
    def _probe(self):
 
3536
        try:
 
3537
            import subunit
 
3538
            return True
 
3539
        except ImportError:
 
3540
            return False
 
3541
 
 
3542
    def feature_name(self):
 
3543
        return 'subunit'
 
3544
 
 
3545
SubUnitFeature = _SubUnitFeature()
 
3546
# Only define SubUnitBzrRunner if subunit is available.
 
3547
try:
 
3548
    from subunit import TestProtocolClient
 
3549
    class SubUnitBzrRunner(TextTestRunner):
 
3550
        def run(self, test):
 
3551
            # undo out claim for testing which looks like a test start to subunit
 
3552
            self.stream.write("success: %s\n" % (osutils.realpath(sys.argv[0]),))
 
3553
            result = TestProtocolClient(self.stream)
 
3554
            test.run(result)
 
3555
            return result
 
3556
except ImportError:
 
3557
    pass