Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault when attempting to test FApplication #97

Open
genedan opened this issue Jun 23, 2023 · 1 comment
Open

Segmentation fault when attempting to test FApplication #97

genedan opened this issue Jun 23, 2023 · 1 comment
Assignees
Labels
bug Something isn't working testing

Comments

@genedan
Copy link
Collaborator

genedan commented Jun 23, 2023

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

@genedan genedan added bug Something isn't working testing labels Jun 23, 2023
genedan added a commit that referenced this issue Jun 24, 2023
…need for it.

This is in part due to difficulties in testing it, see:

#97
@odddkidout
Copy link
Contributor

picking this up @genedan

genedan added a commit that referenced this issue Jul 15, 2023
…need for it.

This is in part due to difficulties in testing it, see:

#97
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working testing
Projects
None yet
Development

No branches or pull requests

2 participants