diff options
| author | Natan Yellin <aantn@users.noreply.github.com> | 2024-03-27 05:58:42 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-27 05:58:42 +0200 |
| commit | 5546aef84aee5c2e290735f9cc658b8461eef4a1 (patch) | |
| tree | 5d00fb022c6d54985648d82918efceac02978ef8 /tests/conftest.py | |
| parent | 9fc5752297567790563ce1cd6e8f0212756a9373 (diff) | |
| parent | ba140253ac140acba61a0caf55791bed179ef297 (diff) | |
Merge branch 'main' into show_cluster_name_flag
Diffstat (limited to 'tests/conftest.py')
| -rw-r--r-- | tests/conftest.py | 13 |
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 |
