Migrate cvp-sanity to Python3
* use print function from future
* convert dict keys and values to list
* do not use bunch imports
* fix requirements mismatch
Related: PROD-33849
Change-Id: Ifecc3a9dcdcfe3243f7dcf2c709a80e9a7c765a1
diff --git a/test_set/cvp-sanity/fixtures/base.py b/test_set/cvp-sanity/fixtures/base.py
index 754f872..bd62ed4 100644
--- a/test_set/cvp-sanity/fixtures/base.py
+++ b/test_set/cvp-sanity/fixtures/base.py
@@ -1,3 +1,5 @@
+from __future__ import print_function
+from builtins import str
import os
import pytest
import atexit
@@ -29,7 +31,7 @@
nodes = utils.calculate_groups()
-@pytest.fixture(scope='session', params=nodes.items(), ids=nodes.keys())
+@pytest.fixture(scope='session', params=list(nodes.items()), ids=list(nodes.keys()))
def nodes_in_group(request):
return request.param
@@ -142,7 +144,7 @@
)
if not kdt_nodes_available:
pytest.skip("No 'kdt' nodes found. Skipping this test...")
- return kdt_nodes_available.keys()
+ return list(kdt_nodes_available.keys())
@pytest.fixture(scope='session')
@@ -153,7 +155,7 @@
)
if not kfg_nodes_available:
pytest.skip("No cfg-under-Kubernetes nodes found. Skipping this test...")
- return kfg_nodes_available.keys()
+ return list(kfg_nodes_available.keys())
@pytest.fixture(scope='session')
@@ -191,8 +193,8 @@
expr_form='compound')
if list_version.__len__() == 0:
yield
- parsed = {k: v.split('\n') for k, v in list_version.items()}
- columns = [name.split('=')[0] for name in parsed.values()[0]]
+ parsed = {k: v.split('\n') for k, v in list(list_version.items())}
+ columns = [name.split('=')[0] for name in list(parsed.values())[0]]
template = "{:<40} | {:<25} | {:<25} | {:<25}\n"