Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
JanCaha committed Nov 13, 2024
1 parent a245c6f commit 08089e4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import pytest
from pytest_qgis.utils import clean_qgis_layer
from qgis.core import QgsFeature, QgsRasterLayer, QgsVectorLayer
from qgis.core import Qgis, QgsFeature, QgsRasterLayer, QgsVectorLayer
from qgis.gui import QgisInterface

from los_tools.constants.field_names import FieldNames
Expand Down Expand Up @@ -220,3 +220,12 @@ def add_message(message, level):
qgis_iface.messageBar().pushMessage("Patched", message, level=level, duration=0)

return add_message


@pytest.fixture(autouse=True, scope="function")
def _clear_message_bar_messages(qgis_iface: QgisInterface):
mb = qgis_iface.messageBar()
mb.messages[Qgis.MessageLevel.Info] = []
mb.messages[Qgis.MessageLevel.Warning] = []
mb.messages[Qgis.MessageLevel.Critical] = []
mb.messages[Qgis.MessageLevel.Success] = []

0 comments on commit 08089e4

Please sign in to comment.