Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
clear cache for testing call count
Browse files Browse the repository at this point in the history
  • Loading branch information
kevingrismore committed Feb 2, 2024
1 parent 3cecd45 commit 9ed5875
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/test_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@

from prefect_kubernetes import KubernetesWorker
from prefect_kubernetes.utilities import _slugify_label_value, _slugify_name
from prefect_kubernetes.worker import KubernetesWorkerJobConfiguration
from prefect_kubernetes.worker import (
KubernetesWorkerJobConfiguration,
_get_cached_kubernetes_client,
)

FAKE_CLUSTER = "fake-cluster"
MOCK_CLUSTER_UID = "1234"
Expand Down Expand Up @@ -1978,6 +1981,7 @@ async def test_defaults_to_incluster_config(
mock_cluster_config,
mock_batch_client,
):
_get_cached_kubernetes_client.cache_clear()
mock_watch.stream = _mock_pods_stream_that_returns_running_pod

async with KubernetesWorker(work_pool_name="test") as k8s_worker:
Expand All @@ -1995,6 +1999,7 @@ async def test_uses_cluster_config_if_not_in_cluster(
mock_cluster_config,
mock_batch_client,
):
_get_cached_kubernetes_client.cache_clear()
mock_watch.stream = _mock_pods_stream_that_returns_running_pod
mock_cluster_config.load_incluster_config.side_effect = ConfigException()
async with KubernetesWorker(work_pool_name="test") as k8s_worker:
Expand Down

0 comments on commit 9ed5875

Please sign in to comment.