File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 1818# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1919# SOFTWARE.
2020
21- import os , unittest , shutil
21+ import os , sys , unittest , shutil
2222
2323import pytest
2424from roundup .backends import get_backend , have_backend
3434from .test_sqlite import sqliteOpener
3535from .test_anydbm import anydbmOpener
3636
37+ try :
38+ from unittest import mock
39+ except ImportError :
40+ import mock
41+
3742try :
3843 import xapian
3944 skip_xapian = lambda func , * args , ** kwargs : func
@@ -280,14 +285,12 @@ def test_xapian_autoselect(self):
280285
281286 @skip_whoosh
282287 def test_whoosh_autoselect (self ):
283- import mock , sys
284288 with mock .patch .dict ('sys.modules' ,
285289 {'roundup.backends.indexer_xapian' : None }):
286290 indexer = get_indexer (self .db .config , self .db )
287291 self .assertIn ('roundup.backends.indexer_whoosh.Indexer' , str (indexer ))
288292
289293 def test_native_autoselect (self ):
290- import mock , sys
291294 with mock .patch .dict ('sys.modules' ,
292295 {'roundup.backends.indexer_xapian' : None ,
293296 'roundup.backends.indexer_whoosh' : None }):
You can’t perform that action at this time.
0 commit comments