pytest-qt: macos 14.0 (sonoma) doesn't pass control to qt

Just updated a computer to macos 14.0 and noticed something quite different about the way in which python is starting the Qt application, which has some pretty big implications for running tests locally in pytest-qt.

When running pytest on the following code, the terminal simply blocks and nothing happens until you manually switch to the ~additional python process~ new application that was started:

def test_qtbot(qtbot):
    assert True

https://github.com/pytest-dev/pytest-qt/assets/1609449/49f088f7-6fb8-48a3-97b5-49b52bfefdae

(I’ve noticed a similar thing in IPython: where starting an interactive event loop with %gui qt always used to switch the current macos app over to the new python ~process~ app in the dock … and now it just starts it in the background).

Anyway, not yet sure what could be done here to allow tests to proceed without manually switching over to the new app.

cc @nicoddemus @The-Compiler … curious if you guys have thoughts?

About this issue

  • Original URL
  • State: closed
  • Created 9 months ago
  • Comments: 16 (4 by maintainers)

Most upvoted comments

By the way, the new App Activation API in Sonoma sounds somewhat relevant, especially the part

cooperative app activation reduces unexpected application switches, for example, an app switch while you are in the middle of typing.

If it there’s a solution, and is easy to integrate with pytest-qt, it would be fine, but I suspect it is more complicate than that.

I will close for now, but if you discover anything interesting @tlambert03, please report back and we can decide on the next course of action if any. 👍