Skip to content

Commit 325cad0

Browse files
authored
Merge pull request #1572 from janezd/cn2-fix-tests
CN2: Remove time consuming tests and prints
2 parents bfdae0a + 5000a2e commit 325cad0

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Orange/tests/test_classification.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import Orange.classification
1414
from Orange.classification import (Learner, Model, NaiveBayesLearner,
1515
LogisticRegressionLearner, NuSVMLearner)
16+
from Orange.classification.rules import _RuleLearner
1617
from Orange.data import (ContinuousVariable, DiscreteVariable,
1718
Domain, Table, Variable)
1819
from Orange.evaluation import CrossValidation
@@ -240,6 +241,9 @@ def test_missing_class(self):
240241
learner = learner()
241242
if isinstance(learner, NuSVMLearner):
242243
learner.params["nu"] = 0.01
244+
# Skip slow tests
245+
if isinstance(learner, _RuleLearner):
246+
continue
243247
model = learner(table)
244248
model(table)
245249
except TypeError:
@@ -285,6 +289,9 @@ def test_all_models_work_after_unpickling(self):
285289
print('%s cannot be used with default parameters' % learner.__name__)
286290
traceback.print_exc()
287291
continue
292+
# Skip slow tests
293+
if isinstance(learner, _RuleLearner):
294+
continue
288295

289296
for ds in datasets:
290297
model = learner(ds)

Orange/tests/test_rules.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,5 @@ def testArgMaxRnd(self):
209209
self.assertEqual(argmaxrnd(temp, hash_dist(np.array([3, 4]))), 5)
210210
self.assertRaises(ValueError, argmaxrnd, np.ones((1, 1, 1)))
211211

212-
def testMain(self):
213-
# test that the examples in rules.main raise no errors
214-
rules_main()
215-
216212
if __name__ == '__main__':
217213
unittest.main()

0 commit comments

Comments
 (0)