summaryrefslogtreecommitdiffstats
path: root/build/platform/python/tests/testlib.py
diff options
context:
space:
mode:
authorAleksandr <[email protected]>2022-02-10 16:47:52 +0300
committerDaniil Cherednik <[email protected]>2022-02-10 16:47:52 +0300
commitea6c5b7f172becca389cacaff7d5f45f6adccbe6 (patch)
treed16cef493ac1e092b4a03ab9437ec06ffe3d188f /build/platform/python/tests/testlib.py
parent37de222addabbef336dcaaea5f7c7645a629fc6d (diff)
Restoring authorship annotation for Aleksandr <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'build/platform/python/tests/testlib.py')
-rw-r--r--build/platform/python/tests/testlib.py36
1 files changed, 18 insertions, 18 deletions
diff --git a/build/platform/python/tests/testlib.py b/build/platform/python/tests/testlib.py
index d12f2815d48..92fc571778f 100644
--- a/build/platform/python/tests/testlib.py
+++ b/build/platform/python/tests/testlib.py
@@ -1,21 +1,21 @@
-import os
-import subprocess
-
-import yatest.common
-
-
-def get_python_bin(ver):
+import os
+import subprocess
+
+import yatest.common
+
+
+def get_python_bin(ver):
res_name = 'EXTERNAL_PYTHON{}_RESOURCE_GLOBAL'.format(ver.replace('.', ''))
- gr = yatest.common.global_resources()
- if res_name in gr:
- bindir = os.path.join(gr[res_name], 'python', 'bin')
+ gr = yatest.common.global_resources()
+ if res_name in gr:
+ bindir = os.path.join(gr[res_name], 'python', 'bin')
if ('python' + ver) in os.listdir(bindir):
return os.path.join(bindir, 'python' + ver)
- return os.path.join(bindir, 'python')
-
- raise AssertionError("Resource '{}' is not available: {}".format(res_name, gr))
-
-
-def check_python_version(version):
- ver = subprocess.check_output([get_python_bin(version), '-V'], stderr=subprocess.STDOUT).decode('utf-8')
- assert version in ver
+ return os.path.join(bindir, 'python')
+
+ raise AssertionError("Resource '{}' is not available: {}".format(res_name, gr))
+
+
+def check_python_version(version):
+ ver = subprocess.check_output([get_python_bin(version), '-V'], stderr=subprocess.STDOUT).decode('utf-8')
+ assert version in ver