Skip to content

Commit bf167fe

Browse files
authored
Update conftest.py
fix: error in pytest_qgis
1 parent fd0f55a commit bf167fe

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

conftest.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
import os
44
import sys
55

6+
# Fortell pytest at den skal laste pytest-qgis-pluginen
7+
pytest_plugins = "pytest_qgis"
8+
69
# Legg til prosjekt-roten OG submodule-mappen i sys.path
710
# slik at importer som 'import geovita_processing_plugin' og 'import Utils' fungerer
811
project_root = os.path.abspath(os.path.dirname(__file__))
@@ -22,7 +25,7 @@ def init_qgis_processing(qgis_app):
2225
print("Processing Framework Initialized.")
2326
except ImportError as e:
2427
print(f"Could not import Processing: {e}")
25-
pytest.skip("Failed to import QGIS Processing framework")
28+
pytest.skip(f"Failed to import QGIS Processing framework: {e}")
2629

2730
print("Registering Geovita provider...")
2831
try:
@@ -34,9 +37,10 @@ def init_qgis_processing(qgis_app):
3437
print(f"Successfully added provider: {provider.id()}")
3538
else:
3639
print("Failed to add provider.")
40+
pytest.skip("Failed to add Geovita provider")
3741
except ImportError as e:
3842
print(f"Could not import Geovita provider: {e}")
39-
pytest.skip("Failed to import Geovita provider")
43+
pytest.skip(f"Failed to import Geovita provider: {e}")
4044

4145
yield
4246

0 commit comments

Comments
 (0)