From 57f0568d1b3969516e920d33d966feac9691bb27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?xavier=20dupr=C3=A9?= Date: Fri, 16 Apr 2021 00:45:58 +0200 Subject: [PATCH] disable on test on keras2onnx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xavier dupré --- tests/utils/test_utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/utils/test_utils.py b/tests/utils/test_utils.py index cedfa6686..c28b24598 100644 --- a/tests/utils/test_utils.py +++ b/tests/utils/test_utils.py @@ -5,6 +5,7 @@ """ import os import unittest +import warnings import onnxmltools from onnxmltools.utils import load_model, save_model from onnxmltools.utils import set_model_version, set_model_domain, set_model_doc_string @@ -59,7 +60,11 @@ def test_set_docstring_blank(self): class TestWrapper(unittest.TestCase): def test_keras_with_tf2onnx(self): - import keras2onnx + try: + import keras2onnx + except ImportError: + warnings.warn("keras2onnx or one of its dependencies is missing.") + return from keras2onnx.proto import keras from keras2onnx.proto.tfcompat import is_tf2 if not is_tf2: # tf2onnx is not available for tensorflow 2.0 yet.