summaryrefslogtreecommitdiff
path: root/tests/conftest.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/conftest.py')
-rw-r--r--tests/conftest.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index 8906c42..61c389d 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -95,6 +95,19 @@ def mock_prometheus_load_pods():
@pytest.fixture(autouse=True, scope="session")
+def mock_prometheus_get_history_range():
+ async def get_history_range(self, history_duration: timedelta) -> tuple[datetime, datetime]:
+ now = datetime.now()
+ start = now - history_duration
+ return start, now
+
+ with patch(
+ "robusta_krr.core.integrations.prometheus.loader.PrometheusMetricsLoader.get_history_range", get_history_range
+ ):
+ yield
+
+
+@pytest.fixture(autouse=True, scope="session")
def mock_prometheus_init():
with patch("robusta_krr.core.integrations.prometheus.loader.PrometheusMetricsLoader.__init__", return_value=None):
yield