Skip to content

Commit

Permalink
diable tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xadupre committed Dec 21, 2024
1 parent 34a4c05 commit 1dd0833
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
10 changes: 7 additions & 3 deletions tests/test_sklearn_tfidf_transformer_converter_sparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import packaging.version as pv
import unittest
import urllib.error
import sys
import onnx
from sklearn.datasets import fetch_20newsgroups
Expand Down Expand Up @@ -41,9 +42,12 @@ def test_model_tfidf_transform_bug(self):
"comp.graphics",
"sci.med",
]
twenty_train = fetch_20newsgroups(
subset="train", categories=categories, shuffle=True, random_state=0
)
try:
twenty_train = fetch_20newsgroups(
subset="train", categories=categories, shuffle=True, random_state=0
)
except urllib.error.HTTPError as e:
raise unittest.SkipTest(f"HTTP fails due to {e}")
text_clf = Pipeline(
[("vect", CountVectorizer()), ("tfidf", TfidfTransformer())]
)
Expand Down
11 changes: 9 additions & 2 deletions tests/test_sklearn_tfidf_vectorizer_converter_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"""

import unittest
import urllib.error
import packaging.version as pv
import numpy as np
import onnx
Expand All @@ -26,7 +27,10 @@ class TestSklearnTfidfVectorizerDataSet(unittest.TestCase):
@unittest.skipIf(TARGET_OPSET < 9, reason="not available")
@unittest.skipIf(TARGET_OPSET < 18, reason="too long")
def test_tfidf_20newsgroups(self):
data = fetch_20newsgroups()
try:
data = fetch_20newsgroups()
except urllib.error.HTTPError as e:
raise unittest.SkipTest(f"HTTP fails due to {e}")
X, y = np.array(data.data)[:100], np.array(data.target)[:100]
X_train, X_test, y_train, y_test = train_test_split(
X, y, test_size=0.5, random_state=42
Expand All @@ -50,7 +54,10 @@ def test_tfidf_20newsgroups(self):
@unittest.skipIf(TARGET_OPSET < 9, reason="not available")
@unittest.skipIf(TARGET_OPSET < 18, reason="too long")
def test_tfidf_20newsgroups_nolowercase(self):
data = fetch_20newsgroups()
try:
data = fetch_20newsgroups()
except urllib.error.HTTPError as e:
raise unittest.SkipTest(f"HTTP fails due to {e}")
X, y = np.array(data.data)[:100], np.array(data.target)[:100]
X_train, X_test, y_train, y_test = train_test_split(
X, y, test_size=0.5, random_state=42
Expand Down

0 comments on commit 1dd0833

Please sign in to comment.