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

Commit

Permalink
reset client before each test
Browse files Browse the repository at this point in the history
Signed-off-by: Max Falk <[email protected]>
  • Loading branch information
gmdfalk committed Oct 19, 2023
1 parent 0cace6c commit 35fa31a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/kubernetes/util_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from kubernetes.client.models.v1_node_selector_requirement import V1NodeSelectorRequirement
from kubernetes.client.models.v1_node_selector_term import V1NodeSelectorTerm

from clusterman.kubernetes.util import CachedCoreV1Api
from clusterman.kubernetes.util import CachedCoreV1Api, KubeApiClientWrapper
from clusterman.kubernetes.util import ConciseCRDApi
from clusterman.kubernetes.util import get_node_kernel_version
from clusterman.kubernetes.util import get_node_lsbrelease
Expand All @@ -16,6 +16,8 @@

@pytest.fixture
def mock_cached_core_v1_api():
# Make sure we always reset the client before each test
KubeApiClientWrapper._client = None
with mock.patch("clusterman.kubernetes.util.kubernetes"):
yield CachedCoreV1Api("/foo/bar/admin.conf")

Expand Down

0 comments on commit 35fa31a

Please sign in to comment.