fix the unittest of test_check_import_scipy on V100 (#21853)

1.6.2
silingtong123 5 years ago committed by liuwei1031
parent a25418b32c
commit 879e3074ea

@ -11,22 +11,22 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#import paddle
#from paddle.importScipy import funcImportScipy
import six.moves.builtins as builtins
from paddle.check_import_scipy import check_import_scipy
import unittest
def my_import(name, globals=None, locals=None, fromlist=(), level=0):
raise ImportError('DLL load failed,unittest: import scipy failed')
raise ImportError('DLL load failed, unittest: import scipy failed')
class importTest(unittest.TestCase):
def test_import(self):
testOsName = 'nt'
old_import = builtins.__import__
builtins.__import__ = my_import
self.assertRaises(ImportError, check_import_scipy, testOsName)
builtins.__import__ = old_import
if __name__ == '__main__':

Loading…
Cancel
Save