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

  • Committer: Jelmer Vernooij
  • Date: 2017-10-26 11:10:38 UTC
  • mfrom: (6791.2.7 python3)
  • Revision ID: jelmer@jelmer.uk-20171026111038-cvils4aykn7ffcju
Merge lp:~jelmer/brz/fix-imports.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Tests for plugins"""
18
18
 
19
 
import imp
 
19
try:
 
20
    from importlib.util import module_from_spec
 
21
except ImportError:  # python < 3
 
22
    from imp import new_module as module_from_spec
20
23
import importlib
21
24
import logging
22
25
import os
49
52
        super(BaseTestPlugins, self).setUp()
50
53
        self.module_name = "breezy.testingplugins"
51
54
        self.module_prefix = self.module_name + "."
52
 
        self.module = imp.new_module(self.module_name)
 
55
        self.module = module_from_spec(self.module_name)
53
56
 
54
57
        self.overrideAttr(plugin, "_MODULE_PREFIX", self.module_prefix)
55
58
        self.overrideAttr(breezy, "testingplugins", self.module)