Skip to content

Commit

Permalink
feat: open QGIS parent even when gui is disabled [GispoCoding#41]
Browse files Browse the repository at this point in the history
  • Loading branch information
Joonalai committed Jun 26, 2023
1 parent 8bf5836 commit 2a10245
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/pytest_qgis/pytest_qgis.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,24 +332,24 @@ def _initialize_processing(qgis_app: QgsApplication) -> None:
def _show_qgis_dlg(
common_settings: Settings, qgis_parent: QWidget, settings: ShowMapSettings
) -> None:
if common_settings.gui_enabled and not common_settings.qgis_init_disabled:
if not common_settings.qgis_init_disabled:
qgis_parent.setWindowTitle("Test QGIS dialog opened by Pytest-qgis")
if settings.full_screen:
qgis_parent.showFullScreen()
else:
qgis_parent.show()
elif not common_settings.gui_enabled:
warnings.warn(
"Cannot show QGIS map because the GUI is not enabled. "
"Set qgis_qui_enabled=True in pytest.ini.",
stacklevel=1,
)
elif common_settings.qgis_init_disabled:
warnings.warn(
"Cannot show QGIS map because QGIS is not initialized. "
"Run the tests without --qgis_disable_init to enable QGIS map.",
stacklevel=1,
)
if not common_settings.gui_enabled:
warnings.warn(
"QGIS map is not visible because the GUI is not enabled. "
"Set qgis_qui_enabled=True in pytest.ini to see the window.",
stacklevel=1,
)


def _configure_qgis_map(
Expand Down

0 comments on commit 2a10245

Please sign in to comment.