How can can I run tests using qtbot on macos Sonoma?

Georgy Ivanov

After upgrade to MacOS Sonoma, even simple tests like

def test_repro(qtbot):
    pass

hang indefinitely.

The related github issue has been closed, without any suggested workarounds.

Can someone perhaps come up with any workarounds here?

Georgy Ivanov

While there's an ongoing discussion on the github issue, and the new App Activation API is pointed out as a suspected culprit, what worked for me was to replace

def _process_events():
    """Calls app.processEvents() while taking care of capturing exceptions
    or not based on the given item's configuration.
    """
    app = qt_api.QtWidgets.QApplication.instance()
    if app is not None:
        app.processEvents()

with

def _process_events():
    """Calls app.processEvents() while taking care of capturing exceptions
    or not based on the given item's configuration.
    """
    app = qt_api.QtWidgets.QApplication.instance()
    if app is not None:
        # app.processEvents()
        pass

in pytestqt/plugin.py.

In my case, I was able to edit it from PyCharm, it was under "External libraries -> Python 3.11 -> site-packages -> pytestqt -> plugin.py".

Not sure if it broke some other important functionality in qtbot, but at least my tests began to pass, and unblocked me in the short run.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How I can synchronize run of tests using Vividus tool?

How can I run kotlintest tests with gradle?

How can I run tests with a headless browser?

How can I run testfx tests in series?

How can I run Jasmine tests with Deno?

With Rails using Minitest, how can I set up RuboCop to run automatically each time tests are run with rake?

I can't run tests

py2app: How can I run tests using the bundled python interpreter?

How can I prevent tests from being run when using exec-maven-plugin

How can I run gtest in C++ code using CMake? (tests not seen)

How do i fix this .bat file so it can run in macOS?

How can I run macOS terminal commands from Swift?

How can I create and run SikuliX scripts on MacOS?

How can I run all Tests classes in Project by TestNG?

How can I run cleanup method only after tagged tests?

How can I create and run tests on PCL code in Xamarin?

How can I run my independent Robotium UI tests in parallel?

How can I run XUnit tests from within Visual Studio?

How can I run the IntelliJ debugger on unit tests in a Maven project?

How can I run PHPUnit with CakePHP tests without the Cake console?

How can I run headless browser system tests in Rails 5.1?

How can I get mocha to run my tests in isolation?

How can I run .NET Core unit tests in Bamboo?

How can I specify TestNG tests to run in Jenkins build?

How can I run google death tests in debug only?

How can I run NUnit tests in Visual Studio 2017?

How can I conditionally run a suite of tests based on iOS device?

How can I run Nightwatch tests in a specific order?

How can I run unit tests without calling application callback