mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-28 18:02:38 +02:00

By default, `pytest-qt` initializes the default QApplication class that PySide offers. Dangerzone, however, defines its own QApplication subclass. Create a `qapp_cls` fixture that will force `pytest-qt` to use this subclass. For more info, see: https://pytest-qt.readthedocs.io/en/latest/qapplication.html#testing-custom-qapplications
12 lines
338 B
Python
12 lines
338 B
Python
import typing
|
|
|
|
import pytest
|
|
|
|
from dangerzone.gui import Application
|
|
|
|
|
|
# Use this fixture to make `pytest-qt` invoke our custom QApplication.
|
|
# See https://pytest-qt.readthedocs.io/en/latest/qapplication.html#testing-custom-qapplications
|
|
@pytest.fixture(scope="session")
|
|
def qapp_cls() -> typing.Type[Application]:
|
|
return Application
|