-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Close and delete Qt widgets that are under test
By using qtbot.add_widget on the created widgets they will be automatically closed and deleted after each test.
- Loading branch information
Showing
22 changed files
with
75 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,7 @@ | |
from mslib.mscolab.conf import mscolab_settings | ||
from PyQt5 import QtCore, QtTest, QtWidgets | ||
from tests.utils import (mscolab_start_server, mscolab_register_and_login, mscolab_create_operation, | ||
mscolab_delete_all_operations, mscolab_delete_user) | ||
mscolab_delete_all_operations, mscolab_delete_user, set_force_close) | ||
from mslib.msui import mscolab | ||
from mslib.msui import msui | ||
from mslib.mscolab.mscolab import handle_db_reset | ||
|
@@ -52,6 +52,7 @@ def setup(self, qtbot): | |
self.process, self.url, self.app, _, self.cm, self.fm = mscolab_start_server(PORTS) | ||
QtTest.QTest.qWait(500) | ||
self.window = msui.MSUIMainWindow(mscolab_data_dir=mscolab_settings.MSCOLAB_DATA_DIR) | ||
qtbot.add_widget(self.window, before_close_func=set_force_close) | ||
self.window.create_new_flight_track() | ||
self.emailid = '[email protected]' | ||
yield | ||
|
@@ -64,8 +65,6 @@ def setup(self, qtbot): | |
if mss_dir.exists('local_mscolab_data'): | ||
mss_dir.removetree('local_mscolab_data') | ||
assert mss_dir.exists('local_mscolab_data') is False | ||
if self.window.mscolab.version_window: | ||
self.window.mscolab.version_window.close() | ||
if self.window.mscolab.conn: | ||
self.window.mscolab.conn.disconnect() | ||
QtWidgets.QApplication.processEvents() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.