Skip to content

Commit

Permalink
Merge pull request #4047 from robertcv/fix/owtestscore_progressbar
Browse files Browse the repository at this point in the history
[FIX] Deprecated processEvents argument in Test&Score
  • Loading branch information
lanzagar authored Oct 4, 2019
2 parents 297d32d + dfb7b2d commit 44a6271
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Orange/widgets/evaluate/owtestlearners.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ def migrate_settings(cls, settings_, version):

@Slot(float)
def setProgressValue(self, value):
self.progressBarSet(value, processEvents=False)
self.progressBarSet(value)

def __update(self):
self.__needupdate = False
Expand Down Expand Up @@ -821,7 +821,7 @@ def ondone(_):
task.future = self.__executor.submit(testfunc)
task.future.add_done_callback(ondone)

self.progressBarInit(processEvents=None)
self.progressBarInit()
self.setBlocking(True)
self.setStatusMessage("Running")

Expand All @@ -838,7 +838,7 @@ def __task_complete(self, task):
return

self.setBlocking(False)
self.progressBarFinished(processEvents=None)
self.progressBarFinished()
self.setStatusMessage("")
result = task.future
assert result.done()
Expand Down
9 changes: 9 additions & 0 deletions Orange/widgets/evaluate/tests/test_owtestlearners.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# pylint: disable=missing-docstring
# pylint: disable=protected-access
import unittest
import warnings

import numpy as np
from AnyQt.QtCore import Qt
Expand Down Expand Up @@ -382,6 +383,14 @@ def test_scores_cross_validation(self):
OWTestLearners.KFold, 0),
(0.8, 0.5, 0.5, 0.5, 0.5))))

def test_no_pregressbar_warning(self):
data = Table("iris")[::15]

with warnings.catch_warnings(record=True) as w:
self.send_signal(self.widget.Inputs.train_data, data)
self.send_signal(self.widget.Inputs.learner, MajorityLearner(), 0)
assert not w


class TestHelpers(unittest.TestCase):
def test_results_one_vs_rest(self):
Expand Down

0 comments on commit 44a6271

Please sign in to comment.