Skip to content

Commit

Permalink
Add mainwindow tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ales-erjavec committed Jun 7, 2021
1 parent 1c2e150 commit fb07e86
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
Empty file added Orange/canvas/tests/__init__.py
Empty file.
12 changes: 12 additions & 0 deletions Orange/canvas/tests/test_mainwindow.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from unittest.mock import patch

from Orange.canvas.mainwindow import MainWindow, OUserSettingsDialog
from orangewidget.tests.base import GuiTest


class TestMainWindow(GuiTest):
def test_settings_dialog(self):
mw = MainWindow()
with patch.object(OUserSettingsDialog, "exec", lambda self: 0), \
patch.object(OUserSettingsDialog, "show", lambda self: None):
mw.open_canvas_settings()
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ commands_pre =
# freeze environment
pip freeze
commands =
coverage run {toxinidir}/quietunittest.py Orange.tests Orange.widgets.tests
coverage run {toxinidir}/quietunittest.py Orange.tests Orange.widgets.tests Orange.canvas.tests
coverage run {toxinidir}/quietunittest.py discover Orange.canvas.tests
coverage combine
coverage report

Expand Down

0 comments on commit fb07e86

Please sign in to comment.