Cross-version mock import
This commit is contained in:
parent
b92b364bd9
commit
7b6097ad98
|
@ -1,7 +1,11 @@
|
|||
import re
|
||||
|
||||
import pytest
|
||||
from mock import patch
|
||||
try:
|
||||
from unittest.mock import patch
|
||||
except ImportError:
|
||||
from mock import patch
|
||||
|
||||
|
||||
from ckanext.harvest.harvesters.base import HarvesterBase, munge_tag
|
||||
from ckantoolkit.tests import factories
|
||||
|
|
|
@ -2,7 +2,10 @@ from __future__ import absolute_import
|
|||
import copy
|
||||
|
||||
import json
|
||||
from mock import patch, MagicMock, Mock
|
||||
try:
|
||||
from unittest.mock import patch, MagicMock, Mock
|
||||
except ImportError:
|
||||
from mock import patch, MagicMock, Mock
|
||||
import pytest
|
||||
from requests.exceptions import HTTPError, RequestException
|
||||
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
import pytest
|
||||
from mock import patch
|
||||
try:
|
||||
from unittest.mock import patch
|
||||
except ImportError:
|
||||
from mock import patch
|
||||
|
||||
from ckanext.harvest.model import HarvestObject, HarvestObjectExtra
|
||||
from ckanext.harvest.interfaces import IHarvester
|
||||
|
|
Loading…
Reference in New Issue