Skip to content

Commit

Permalink
workaround for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
maartenbreddels committed Aug 23, 2024
1 parent d3a0413 commit e739ab0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/qtapp/solara-qt-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ def run(port: int):

def test_success(value):
print("test output", value)
app.quit()
# calling app.quit seems to fail on windows and linux
# possibly because we are in a non-qt-thread (solara)
# app.quit()
QtCore.QMetaObject.invokeMethod(app, "quit", QtCore.Qt.QueuedConnection)
server.stop_serving()

test_app.callback = test_success # type: ignore
Expand All @@ -46,7 +49,8 @@ def fail_guard():
sleep(10)
nonlocal failed
print("failed")
app.quit()
# similar as above
QtCore.QMetaObject.invokeMethod(app, "quit", QtCore.Qt.QueuedConnection)
failed = True

app = QApplication([""])
Expand Down

0 comments on commit e739ab0

Please sign in to comment.