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

  • Committer: Jelmer Vernooij
  • Date: 2020-02-21 04:28:46 UTC
  • mfrom: (7494 work)
  • mto: This revision was merged to the branch mainline in revision 7496.
  • Revision ID: jelmer@jelmer.uk-20200221042846-r8lzqu0jetkw772i
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
    )
28
28
from ..controldir import ControlDir
29
29
from ..bzr.smart import medium
30
 
from ..sixish import PY3
31
30
from ..transport import remote
32
31
 
33
32
from . import (
104
103
 
105
104
        bad_modules = []
106
105
        for module_name in forbidden_imports:
107
 
            if PY3:
108
 
                if err.find("\nimport '%s' " % module_name) != -1:
109
 
                    bad_modules.append(module_name)
110
 
            else:
111
 
                if err.find("\nimport %s " % module_name) != -1:
112
 
                    bad_modules.append(module_name)
 
106
            if err.find("\nimport '%s' " % module_name) != -1:
 
107
                bad_modules.append(module_name)
113
108
 
114
109
        if bad_modules:
115
110
            self.fail("command loaded forbidden modules %r"
197
192
            'termios',
198
193
            'tty',
199
194
            ] + old_format_modules
200
 
        if PY3:
201
 
            # On Python 2, scandir imports ctypes, which imports tempfile.
202
 
            forbidden_modules.append('tempfile')
203
195
        self.run_command_check_imports(['st'], forbidden_modules)
204
196
        # TODO: similar test for repository-only operations, checking we avoid
205
197
        # loading wt-specific stuff