File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change 88
99import anyio
1010import pytest
11- from packaging .version import parse as parse_version
1211
1312import kr8s
1413import kr8s .asyncio
1514from kr8s ._async_utils import anext
15+ from kr8s ._constants import (
16+ KUBERNETES_MAXIMUM_SUPPORTED_VERSION ,
17+ KUBERNETES_MINIMUM_SUPPORTED_VERSION ,
18+ )
1619from kr8s ._exceptions import APITimeoutError
1720from kr8s .asyncio .objects import Pod , Service , Table
1821from kr8s .objects import Pod as SyncPod
@@ -534,11 +537,15 @@ async def test_bad_kubernetes_version(version):
534537 api .async_version = keep
535538
536539
537- async def test_good_kubernetes_version ():
538- from kr8s ._constants import KUBERNETES_MAXIMUM_SUPPORTED_VERSION as v
539-
540- # Create a version that is just above the maximum supported version
541- version = str (parse_version (f"{ v .major } .{ v .minor } .{ v .micro + 15 } " ))
540+ @pytest .mark .parametrize (
541+ "version" ,
542+ [
543+ str (KUBERNETES_MINIMUM_SUPPORTED_VERSION ),
544+ str (KUBERNETES_MAXIMUM_SUPPORTED_VERSION ),
545+ f"{ KUBERNETES_MAXIMUM_SUPPORTED_VERSION .major } .{ KUBERNETES_MAXIMUM_SUPPORTED_VERSION .minor } .15" ,
546+ ],
547+ )
548+ async def test_good_kubernetes_version (version ):
542549 api = await kr8s .asyncio .api ()
543550 keep = api .async_version
544551 api .async_version = AsyncMock (return_value = {"gitVersion" : version })
You can’t perform that action at this time.
0 commit comments