Skip to content

Commit d60d521

Browse files
committed
skip the blob failed model tests
1 parent f1ee0b4 commit d60d521

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

tests/keras2onnx_applications/nightly_build/test_transformers.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,20 @@
2121
if os.environ.get('ENABLE_FULL_TRANSFORMER_TEST', '0') != '0':
2222
enable_transformer_test = True
2323

24+
def check_bloburl_access():
25+
url = r'https://lotus.blob.core.windows.net/converter-models/transformer_tokenizer/'
26+
try:
27+
response = urllib.request.urlopen(url)
28+
if response.getcode() != 200:
29+
return False
30+
except urllib.error.URLError:
31+
return False
32+
return True
33+
2434

2535
@unittest.skipIf(is_tensorflow_older_than('2.1.0'),
2636
"Transformers conversion need tensorflow 2.1.0+")
37+
@unittest.skipIf(check_bloburl_access(), "Model blob url can't access")
2738
class TestTransformers(unittest.TestCase):
2839

2940
text_str = 'The quick brown fox jumps over lazy dog.'

tests/keras2onnx_applications/nightly_build/test_yolov3.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@
2525
tmp_path = os.path.join(working_path, 'temp')
2626

2727

28+
def check_bloburl_access(url):
29+
try:
30+
response = urllib.request.urlopen(url)
31+
if response.getcode() != 200:
32+
return False
33+
except urllib.error.URLError:
34+
return False
35+
return True
36+
37+
2838
class TestYoloV3(unittest.TestCase):
2939

3040
def setUp(self):
@@ -45,6 +55,8 @@ def post_compute(self, all_boxes, all_scores, indices):
4555

4656
@unittest.skipIf(StrictVersion(onnx.__version__.split('-')[0]) < StrictVersion("1.5.0"),
4757
"NonMaxSuppression op is not supported for onnx < 1.5.0.")
58+
@unittest.skipIf(check_bloburl_access(YOLOV3_WEIGHTS_PATH) or check_bloburl_access(YOLOV3_TINY_WEIGHTS_PATH),
59+
"Model blob url can't access")
4860
def test_yolov3(self):
4961
img_path = os.path.join(os.path.dirname(__file__), '../data', 'street.jpg')
5062
yolo3_yolo3_dir = os.path.join(os.path.dirname(__file__), '../../../keras-yolo3/yolo3')

0 commit comments

Comments
 (0)