~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/TestUtil.py

  • Committer: John Arbash Meinel
  • Date: 2011-01-10 22:20:12 UTC
  • mfrom: (5582 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5599.
  • Revision ID: john@arbash-meinel.com-20110110222012-mtcqudkvmzwiufuc
Merge in the bzr.dev 5582

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2010 Canonical Ltd
 
1
# Copyright (C) 2005-2011 Canonical Ltd
2
2
#       Author: Robert Collins <robert.collins@canonical.com>
3
3
#
4
4
# This program is free software; you can redistribute it and/or modify
29
29
 
30
30
 
31
31
class LogCollector(logging.Handler):
 
32
 
32
33
    def __init__(self):
33
34
        logging.Handler.__init__(self)
34
35
        self.records=[]
 
36
 
35
37
    def emit(self, record):
36
38
        self.records.append(record.getMessage())
37
39
 
60
62
                visitor.visitSuite(test)
61
63
                visitTests(test, visitor)
62
64
            else:
63
 
                print "unvisitable non-unittest.TestCase element %r (%r)" % (test, test.__class__)
 
65
                print "unvisitable non-unittest.TestCase element %r (%r)" % (
 
66
                    test, test.__class__)
64
67
 
65
68
 
66
69
class TestSuite(unittest.TestSuite):
183
186
 
184
187
class TestVisitor(object):
185
188
    """A visitor for Tests"""
 
189
 
186
190
    def visitSuite(self, aTestSuite):
187
191
        pass
 
192
 
188
193
    def visitCase(self, aTestCase):
189
194
        pass