~jelmer/brz/colocated-spec

« back to all changes in this revision

Viewing changes to breezy/tests/test_clean_tree.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:
20
20
import shutil
21
21
import sys
22
22
 
23
 
from breezy import tests, ui
24
 
from breezy.controldir import (
 
23
from .. import tests, ui
 
24
from ..controldir import (
25
25
    ControlDir,
26
26
    )
27
 
from breezy.clean_tree import (
 
27
from ..clean_tree import (
28
28
    clean_tree,
29
29
    iter_deletables,
30
30
    )
31
 
from breezy.osutils import (
 
31
from ..osutils import (
32
32
    has_symlinks,
33
33
    )
34
 
from breezy.tests import (
 
34
from . import (
35
35
    TestCaseInTempDir,
36
36
    )
37
37
 
103
103
            # proper excinfo that needs to be passed to onerror
104
104
            try:
105
105
                raise OSError
106
 
            except OSError, e:
 
106
            except OSError as e:
107
107
                e.errno = errno.EACCES
108
108
                excinfo = sys.exc_info()
109
109
                function = os.remove
117
117
 
118
118
        self.overrideAttr(os, 'unlink', _dummy_unlink)
119
119
        self.overrideAttr(shutil, 'rmtree', _dummy_rmtree)
120
 
        stdout = tests.StringIOWrapper()
121
 
        stderr = tests.StringIOWrapper()
122
 
        ui.ui_factory = tests.TestUIFactory(stdout=stdout, stderr=stderr)
 
120
        ui.ui_factory = tests.TestUIFactory()
 
121
        stderr = ui.ui_factory.stderr
123
122
 
124
123
        ControlDir.create_standalone_workingtree('.')
125
124
        self.build_tree(['0foo', '1bar', '2baz', 'subdir0/'])