Skip to content

Commit b558053

Browse files
committed
tests: disable for test runner
1 parent 23548da commit b558053

File tree

1 file changed

+79
-79
lines changed

1 file changed

+79
-79
lines changed

tests/conftest.py

Lines changed: 79 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,109 +1,109 @@
1-
import os
2-
import pickle
3-
import importlib
4-
import pytest
1+
# import os
2+
# import pickle
3+
# import importlib
4+
# import pytest
55

6-
from qgis.core import QgsApplication, QgsProcessingContext, QgsProcessingFeedback
6+
# from qgis.core import QgsApplication, QgsProcessingContext, QgsProcessingFeedback
77

88

9-
@pytest.fixture(scope="session", autouse=True)
10-
def qgis_app():
11-
"""Start a headless QGIS application for tests.
9+
# @pytest.fixture(scope="session", autouse=True)
10+
# def qgis_app():
11+
# """Start a headless QGIS application for tests.
1212

13-
Requires QGIS_PREFIX_PATH to be set in the environment (pointing to the QGIS install).
14-
"""
15-
prefix = os.environ.get("QGIS_PREFIX_PATH")
16-
if not prefix:
17-
raise RuntimeError(
18-
"QGIS_PREFIX_PATH environment variable must be set to your QGIS install path for tests to run."
19-
)
13+
# Requires QGIS_PREFIX_PATH to be set in the environment (pointing to the QGIS install).
14+
# """
15+
# prefix = os.environ.get("QGIS_PREFIX_PATH")
16+
# if not prefix:
17+
# raise RuntimeError(
18+
# "QGIS_PREFIX_PATH environment variable must be set to your QGIS install path for tests to run."
19+
# )
2020

21-
app = QgsApplication([], False)
22-
app.setPrefixPath(prefix, True)
23-
app.initQgis()
21+
# app = QgsApplication([], False)
22+
# app.setPrefixPath(prefix, True)
23+
# app.initQgis()
2424

25-
yield app
25+
# yield app
2626

27-
app.exitQgis()
27+
# app.exitQgis()
2828

2929

30-
@pytest.fixture
31-
def qgis_context():
32-
"""Return a fresh processing context."""
33-
return QgsProcessingContext()
30+
# @pytest.fixture
31+
# def qgis_context():
32+
# """Return a fresh processing context."""
33+
# return QgsProcessingContext()
3434

3535

36-
@pytest.fixture
37-
def feedback():
38-
"""Return a simple QgsProcessingFeedback instance for algorithms."""
39-
return QgsProcessingFeedback()
36+
# @pytest.fixture
37+
# def feedback():
38+
# """Return a simple QgsProcessingFeedback instance for algorithms."""
39+
# return QgsProcessingFeedback()
4040

4141

42-
@pytest.fixture
43-
def ensure_loopstructural(monkeypatch):
44-
"""If the real LoopStructural classes are not available, inject minimal fakes into
45-
the algorithm module so tests can run without the external dependency.
42+
# @pytest.fixture
43+
# def ensure_loopstructural(monkeypatch):
44+
# """If the real LoopStructural classes are not available, inject minimal fakes into
45+
# the algorithm module so tests can run without the external dependency.
4646

47-
The algorithm module imports FaultTopology and FaultRelationshipType at import-time
48-
and uses those module-level names; this fixture patches the algorithm module
49-
attributes when they are missing.
50-
"""
51-
mod_name = "loopstructural.processing.algorithms.modelling.add_fault_topology"
52-
mod = importlib.import_module(mod_name)
47+
# The algorithm module imports FaultTopology and FaultRelationshipType at import-time
48+
# and uses those module-level names; this fixture patches the algorithm module
49+
# attributes when they are missing.
50+
# """
51+
# mod_name = "loopstructural.processing.algorithms.modelling.add_fault_topology"
52+
# mod = importlib.import_module(mod_name)
5353

54-
if getattr(mod, "FaultTopology", None) is not None and getattr(mod, "FaultRelationshipType", None) is not None:
55-
# real dependency present; nothing to do
56-
return
54+
# if getattr(mod, "FaultTopology", None) is not None and getattr(mod, "FaultRelationshipType", None) is not None:
55+
# # real dependency present; nothing to do
56+
# return
5757

58-
class _FakeFaultTopology:
59-
def __init__(self, strat_col=None):
60-
self.strat_col = strat_col
61-
self.faults = set()
62-
# store relationships in a dict for simple inspection
63-
self._rels = {}
58+
# class _FakeFaultTopology:
59+
# def __init__(self, strat_col=None):
60+
# self.strat_col = strat_col
61+
# self.faults = set()
62+
# # store relationships in a dict for simple inspection
63+
# self._rels = {}
6464

65-
def add_fault(self, name):
66-
self.faults.add(name)
65+
# def add_fault(self, name):
66+
# self.faults.add(name)
6767

68-
def update_fault_relationship(self, a, b, rel):
69-
self._rels[(a, b)] = rel
68+
# def update_fault_relationship(self, a, b, rel):
69+
# self._rels[(a, b)] = rel
7070

71-
def __repr__(self):
72-
return f"FakeFaultTopology(faults={sorted(self.faults)})"
71+
# def __repr__(self):
72+
# return f"FakeFaultTopology(faults={sorted(self.faults)})"
7373

74-
class _FakeFaultRelationshipType:
75-
ABUTTING = 1
74+
# class _FakeFaultRelationshipType:
75+
# ABUTTING = 1
7676

77-
monkeypatch.setattr(mod, "FaultTopology", _FakeFaultTopology, raising=False)
78-
monkeypatch.setattr(mod, "FaultRelationshipType", _FakeFaultRelationshipType, raising=False)
77+
# monkeypatch.setattr(mod, "FaultTopology", _FakeFaultTopology, raising=False)
78+
# monkeypatch.setattr(mod, "FaultRelationshipType", _FakeFaultRelationshipType, raising=False)
7979

80-
return
80+
# return
8181

8282

83-
@pytest.fixture
84-
def simple_model_pickle(tmp_path):
85-
"""Create and return a path to a simple pickled model object suitable for tests.
83+
# @pytest.fixture
84+
# def simple_model_pickle(tmp_path):
85+
# """Create and return a path to a simple pickled model object suitable for tests.
8686

87-
The returned object has a `features` attribute with simple feature-like objects
88-
exposing a `name` attribute so the algorithm can find faults.
89-
"""
90-
class DummyFeature:
91-
def __init__(self, name):
92-
self.name = name
87+
# The returned object has a `features` attribute with simple feature-like objects
88+
# exposing a `name` attribute so the algorithm can find faults.
89+
# """
90+
# class DummyFeature:
91+
# def __init__(self, name):
92+
# self.name = name
9393

94-
def __repr__(self):
95-
return f"DummyFeature({self.name})"
94+
# def __repr__(self):
95+
# return f"DummyFeature({self.name})"
9696

97-
class DummyModel:
98-
def __init__(self, names=("fault1", "fault2")):
99-
self.features = [DummyFeature(n) for n in names]
97+
# class DummyModel:
98+
# def __init__(self, names=("fault1", "fault2")):
99+
# self.features = [DummyFeature(n) for n in names]
100100

101-
def __repr__(self):
102-
return f"DummyModel(features={self.features})"
101+
# def __repr__(self):
102+
# return f"DummyModel(features={self.features})"
103103

104-
model = DummyModel()
105-
path = tmp_path / "model.pkl"
106-
with open(path, "wb") as fh:
107-
pickle.dump(model, fh)
104+
# model = DummyModel()
105+
# path = tmp_path / "model.pkl"
106+
# with open(path, "wb") as fh:
107+
# pickle.dump(model, fh)
108108

109-
return str(path)
109+
# return str(path)

0 commit comments

Comments
 (0)