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 8, 2021
1 parent 1c2e150 commit 0434bc5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
Empty file added Orange/canvas/tests/__init__.py
Empty file.
13 changes: 13 additions & 0 deletions Orange/canvas/tests/test_mainwindow.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# pylint: disable=all
from unittest.mock import patch

from Orange.canvas.mainwindow import MainWindow, OUserSettingsDialog
from Orange.widgets.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 0434bc5

Please sign in to comment.