diff options
author | Aleksandr <[email protected]> | 2022-02-10 16:47:52 +0300 |
---|---|---|
committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:47:52 +0300 |
commit | b05913d1c3c02a773578bceb7285084d2933ae86 (patch) | |
tree | c0748b5dcbade83af788c0abfa89c0383d6b779c /build/platform/python/tests | |
parent | ea6c5b7f172becca389cacaff7d5f45f6adccbe6 (diff) |
Restoring authorship annotation for Aleksandr <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'build/platform/python/tests')
-rw-r--r-- | build/platform/python/tests/test_common.py | 36 | ||||
-rw-r--r-- | build/platform/python/tests/testlib.py | 36 | ||||
-rw-r--r-- | build/platform/python/tests/ya.make | 68 |
3 files changed, 70 insertions, 70 deletions
diff --git a/build/platform/python/tests/test_common.py b/build/platform/python/tests/test_common.py index f4689ff0a41..7a685330ea7 100644 --- a/build/platform/python/tests/test_common.py +++ b/build/platform/python/tests/test_common.py @@ -1,22 +1,22 @@ -import subprocess - -import pytest - -from build.platform.python.tests import testlib - +import subprocess + +import pytest + +from build.platform.python.tests import testlib + PYTHON_VERSIONS = ["2.7", "3.4", "3.5", "3.6"] # 3.7, 3.8 are not runnable - - [email protected]("pyver", PYTHON_VERSIONS) -def test_version_matched(pyver): - testlib.check_python_version(pyver) - - [email protected]("pyver", PYTHON_VERSIONS) -def test_python_max_unicode_bytes(pyver): - cmd = [testlib.get_python_bin(pyver), '-c', 'import sys; print(sys.maxunicode)'] - maxunicode = subprocess.check_output(cmd, stderr=subprocess.STDOUT).decode('utf-8') - assert int(maxunicode) > 65535, "Found UCS2 build" + + [email protected]("pyver", PYTHON_VERSIONS) +def test_version_matched(pyver): + testlib.check_python_version(pyver) + + [email protected]("pyver", PYTHON_VERSIONS) +def test_python_max_unicode_bytes(pyver): + cmd = [testlib.get_python_bin(pyver), '-c', 'import sys; print(sys.maxunicode)'] + maxunicode = subprocess.check_output(cmd, stderr=subprocess.STDOUT).decode('utf-8') + assert int(maxunicode) > 65535, "Found UCS2 build" @pytest.mark.parametrize("pyver", PYTHON_VERSIONS) diff --git a/build/platform/python/tests/testlib.py b/build/platform/python/tests/testlib.py index 92fc571778f..d12f2815d48 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 diff --git a/build/platform/python/tests/ya.make b/build/platform/python/tests/ya.make index 3915de89698..0d8965240e0 100644 --- a/build/platform/python/tests/ya.make +++ b/build/platform/python/tests/ya.make @@ -1,36 +1,36 @@ -PY3TEST() - -OWNER( - g:contrib - g:yatool -) - -IF (OS_DARWIN) - SIZE(LARGE) - - TAG( - ya:fat - ya:force_sandbox ya:exotic_platform - ) -ENDIF() - -PY_SRCS( - testlib.py -) - -TEST_SRCS( - test_common.py -) - -PEERDIR( - build/platform/python/python27 - build/platform/python/python34 - build/platform/python/python35 - build/platform/python/python36 - build/platform/python/python37 - build/platform/python/python38 +PY3TEST() + +OWNER( + g:contrib + g:yatool +) + +IF (OS_DARWIN) + SIZE(LARGE) + + TAG( + ya:fat + ya:force_sandbox ya:exotic_platform + ) +ENDIF() + +PY_SRCS( + testlib.py +) + +TEST_SRCS( + test_common.py +) + +PEERDIR( + build/platform/python/python27 + build/platform/python/python34 + build/platform/python/python35 + build/platform/python/python36 + build/platform/python/python37 + build/platform/python/python38 build/platform/python/python39 build/platform/python/python310 -) - -END() +) + +END() |