/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 breezy/tests/TestUtil.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-22 00:56:52 UTC
  • mfrom: (6621.2.26 py3_pokes)
  • Revision ID: jelmer@jelmer.uk-20170522005652-yjahcr9hwmjkno7n
Merge Python3 porting work ('py3 pokes')

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
import unittest
22
22
import weakref
23
23
 
24
 
from breezy import pyutils
 
24
from .. import pyutils
25
25
 
26
26
# Mark this python module as being part of the implementation
27
27
# of unittest: this gives us better tracebacks where the last
63
63
                visitor.visitSuite(test)
64
64
                visitTests(test, visitor)
65
65
            else:
66
 
                print "unvisitable non-unittest.TestCase element %r (%r)" % (
67
 
                    test, test.__class__)
 
66
                print("unvisitable non-unittest.TestCase element %r (%r)" % (
 
67
                    test, test.__class__))
68
68
 
69
69
 
70
70
class FailedCollectionCase(unittest.TestCase):
179
179
        >>>         result.addTests([test, test])
180
180
        >>>     return result
181
181
        """
182
 
        if sys.version_info < (2, 7):
183
 
            basic_tests = super(TestLoader, self).loadTestsFromModule(module)
184
 
        else:
185
 
            # GZ 2010-07-19: Python 2.7 unittest also uses load_tests but with
186
 
            #                a different and incompatible signature
187
 
            basic_tests = super(TestLoader, self).loadTestsFromModule(module,
188
 
                use_load_tests=False)
 
182
        # GZ 2010-07-19: Python 2.7 unittest also uses load_tests but with
 
183
        #                a different and incompatible signature
 
184
        basic_tests = super(TestLoader, self).loadTestsFromModule(module,
 
185
            use_load_tests=False)
189
186
        load_tests = getattr(module, "load_tests", None)
190
187
        if load_tests is not None:
191
188
            return load_tests(basic_tests, module, self)