-
-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIX] Resolve deprecations #63
Changes from all commits
5dace18
e6dcec2
3d6fd37
61705ee
4f6e91e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
# pylint: disable=missing-docstring | ||
import unittest | ||
from unittest.mock import Mock | ||
from unittest.mock import Mock, patch | ||
|
||
from AnyQt.QtCore import Qt, QPointF | ||
|
||
from Orange.classification import RandomForestLearner, CalibratedLearner, \ | ||
ThresholdLearner, SimpleRandomForestLearner as SimpleRandomForestClassifier | ||
from Orange.data import Table | ||
from Orange.data.table import DomainTransformationError | ||
from Orange.regression import RandomForestRegressionLearner, \ | ||
SimpleRandomForestLearner | ||
from Orange.tests.test_classification import all_learners as all_cls_learners | ||
|
@@ -39,15 +40,19 @@ def test_input_cls(self): | |
|
||
self.send_signal(self.widget.Inputs.model, self.rf_reg) | ||
self.wait_until_finished() | ||
self.assertTrue(self.widget.Error.unknown_err.is_shown()) | ||
# no error since no attributes in view and those no future is selected | ||
self.assertFalse(self.widget.Error.unknown_err.is_shown()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The model and data domain are different, which results in no attributes in the list view and those no feature is selected. ICE shows an empty graph without error. |
||
|
||
self.send_signal(self.widget.Inputs.model, None) | ||
self.assertFalse(self.widget.Error.unknown_err.is_shown()) | ||
|
||
self.send_signal(self.widget.Inputs.data, self.iris) | ||
self.send_signal(self.widget.Inputs.model, self.rf_cls) | ||
self.wait_until_finished() | ||
self.assertTrue(self.widget.Error.domain_transform_err.is_shown()) | ||
with patch( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I cannot make a case where I hope I didn't miss any cases. I would anyway leave |
||
"orangecontrib.explain.widgets.owice.individual_condition_expectation", | ||
side_effect=DomainTransformationError | ||
): | ||
self.send_signal(self.widget.Inputs.model, self.rf_cls) | ||
self.wait_until_finished() | ||
self.assertTrue(self.widget.Error.domain_transform_err.is_shown()) | ||
|
||
def test_output(self): | ||
self.send_signal(self.widget.Inputs.data, self.heart) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sometimes while filtering,
__on_feature_changed
is called two times. First with a selection change and second without change (both selected and deselected parameters are empty). Since it is safer, useself._features_view.selectionModel().selectedIndexes()
.