Skip to content

Segmentation fault when attempting to test FApplication #97

Description

@genedan

I've got the QApplication subclassed as FApplication:

from PyQt6.QtWidgets import (
    QApplication
)


class FApplication(QApplication):
    def __init__(
        self,
        *argv
    ):
        super().__init__(*argv)

I'm able to run the following test when using a PyCharm context menu or when running the test alone in the terminal. But when I run the entire test suite using $pytest, I wind up with a segmentation fault.

import sys

import pytest

from faslr.core import FApplication

from pytestqt.qtbot import QtBot


@pytest.fixture(scope="session")
def f_application():

    app = FApplication(sys.argv)

    return app


def test_f_application(
        qtbot: QtBot,
        f_application: FApplication
) -> None:

    app = f_application

Some things I've tried doing are adding a line to exit the application. Declaring the application via a fixture was suggested in this guide:

https://pytest-qt.readthedocs.io/en/latest/qapplication.html

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtesting

Type

No type

Fields

Priority

None yet

Scope

None yet

Effort

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions