diff options
author | exprmntr <exprmntr@yandex-team.ru> | 2022-02-10 16:46:50 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:50 +0300 |
commit | 078ddb2fb76387cae14e8c3ceb5a896009a5a539 (patch) | |
tree | dda2d61bf8f818c76b5602b79366b5fcbcf2e479 /library/python/testing/import_test | |
parent | 5085152b94bf621933243a498def7f37d2e76b58 (diff) | |
download | ydb-078ddb2fb76387cae14e8c3ceb5a896009a5a539.tar.gz |
Restoring authorship annotation for exprmntr <exprmntr@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/python/testing/import_test')
-rw-r--r-- | library/python/testing/import_test/import_test.py | 36 | ||||
-rw-r--r-- | library/python/testing/import_test/ya.make | 12 |
2 files changed, 24 insertions, 24 deletions
diff --git a/library/python/testing/import_test/import_test.py b/library/python/testing/import_test/import_test.py index 3e3b7234ef..4981be1298 100644 --- a/library/python/testing/import_test/import_test.py +++ b/library/python/testing/import_test/import_test.py @@ -1,5 +1,5 @@ -from __future__ import print_function - +from __future__ import print_function + import os import re import sys @@ -10,7 +10,7 @@ import __res from __res import importer -def check_imports(no_check=(), extra=(), skip_func=None, py_main=None): +def check_imports(no_check=(), extra=(), skip_func=None, py_main=None): """ tests all bundled modules are importable just add @@ -35,13 +35,13 @@ def check_imports(no_check=(), extra=(), skip_func=None, py_main=None): import_times = {} norm = lambda s: s[:-9] if s.endswith('.__init__') else s - - modules = sys.extra_modules | set(extra) - modules = sorted(modules, key=norm) - if py_main: - modules = [py_main] + modules - - for module in modules: + + modules = sys.extra_modules | set(extra) + modules = sorted(modules, key=norm) + if py_main: + modules = [py_main] + modules + + for module in modules: if module not in extra and (rx.search(module) or skip_func and skip_func(module)): print('SKIP', module) continue @@ -111,14 +111,14 @@ def main(): else: django.setup() - py_main = __res.find('PY_MAIN') - - if py_main: - py_main_module = py_main.split(b':', 1)[0].decode('UTF-8') - else: - py_main_module = None - + py_main = __res.find('PY_MAIN') + + if py_main: + py_main_module = py_main.split(b':', 1)[0].decode('UTF-8') + else: + py_main_module = None + try: - check_imports(no_check=skip_names, py_main=py_main_module) + check_imports(no_check=skip_names, py_main=py_main_module) except: sys.exit(1) diff --git a/library/python/testing/import_test/ya.make b/library/python/testing/import_test/ya.make index fae36ffe8f..707f7c6c87 100644 --- a/library/python/testing/import_test/ya.make +++ b/library/python/testing/import_test/ya.make @@ -2,9 +2,9 @@ OWNER( g:yatest exprmntr ) - -PY23_LIBRARY() - -PY_SRCS(import_test.py) - -END() + +PY23_LIBRARY() + +PY_SRCS(import_test.py) + +END() |