Skip to content

Commit 8454b5e

Browse files
committed
increase timeout
1 parent 91caa79 commit 8454b5e

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

tests/test_app.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import os, sys, asyncio
33

44
from pytestqt.qtbot import QtBot
5+
import pytestqt.exceptions
56

67
if sys.platform == 'win32':
78
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
@@ -93,6 +94,8 @@
9394
sk = cq.Sketch().rect(1,1)
9495
"""
9596

97+
TIMEOUT = 10_000
98+
9699
def _modify_file(code, path="test.py"):
97100
with open(path, "w", 1) as f:
98101
f.write(code)
@@ -150,7 +153,7 @@ def main_clean(qtbot: QtBot, mocker):
150153

151154
win = MainWindow()
152155
qtbot.addWidget(win)
153-
with qtbot.waitExposed(win):
156+
with qtbot.waitExposed(win, timeout=TIMEOUT):
154157
win.show()
155158

156159
editor = win.components['editor']
@@ -165,7 +168,7 @@ def main_clean_do_not_close(qtbot: QtBot, mocker):
165168

166169
win = MainWindow()
167170
qtbot.addWidget(win)
168-
with qtbot.waitExposed(win):
171+
with qtbot.waitExposed(win, timeout=TIMEOUT):
169172
win.show()
170173

171174
editor = win.components['editor']
@@ -181,7 +184,7 @@ def main_multi(qtbot: QtBot, mocker):
181184

182185
win = MainWindow()
183186
qtbot.addWidget(win)
184-
with qtbot.waitExposed(win):
187+
with qtbot.waitExposed(win, timeout=TIMEOUT):
185188
win.show()
186189

187190
editor = win.components['editor']
@@ -662,8 +665,6 @@ def test_editor_autoreload(monkeypatch,editor):
662665

663666
qtbot, editor = editor
664667

665-
TIMEOUT = 500
666-
667668
# start out with autoreload enabled
668669
editor.autoreload(True)
669670

@@ -712,7 +713,6 @@ def test_autoreload_nested(editor):
712713

713714
qtbot, editor = editor
714715

715-
TIMEOUT = 500
716716

717717
editor.autoreload(True)
718718
editor.preferences['Autoreload: watch imported modules'] = True
@@ -1440,7 +1440,6 @@ def makebox(z):
14401440

14411441
def test_reload_import_handle_error(tmp_path, main):
14421442

1443-
TIMEOUT = 500
14441443
qtbot, win = main
14451444
editor = win.components["editor"]
14461445
debugger = win.components["debugger"]
@@ -1481,7 +1480,6 @@ def test_reload_import_handle_error(tmp_path, main):
14811480

14821481
def test_modulefinder(tmp_path, main):
14831482

1484-
TIMEOUT = 500
14851483
qtbot, win = main
14861484
editor = win.components["editor"]
14871485
debugger = win.components["debugger"]

0 commit comments

Comments
 (0)