aboutsummaryrefslogtreecommitdiffstats
path: root/library/python/testing/import_test/import_test.py
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:15 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:15 +0300
commit72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch)
treeda2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /library/python/testing/import_test/import_test.py
parent778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff)
downloadydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'library/python/testing/import_test/import_test.py')
-rw-r--r--library/python/testing/import_test/import_test.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/library/python/testing/import_test/import_test.py b/library/python/testing/import_test/import_test.py
index 3e3b7234ef..370815ed3a 100644
--- a/library/python/testing/import_test/import_test.py
+++ b/library/python/testing/import_test/import_test.py
@@ -8,7 +8,7 @@ import traceback
import __res
from __res import importer
-
+
def check_imports(no_check=(), extra=(), skip_func=None, py_main=None):
"""
@@ -44,8 +44,8 @@ def check_imports(no_check=(), extra=(), skip_func=None, py_main=None):
for module in modules:
if module not in extra and (rx.search(module) or skip_func and skip_func(module)):
print('SKIP', module)
- continue
-
+ continue
+
name = module.rsplit('.', 1)[-1]
if name == '__main__' and 'if __name__ ==' not in importer.get_source(module):
print('SKIP', module, '''without "if __name__ == '__main__'" check''')
@@ -57,7 +57,7 @@ def check_imports(no_check=(), extra=(), skip_func=None, py_main=None):
for l in item.splitlines():
print('FAIL:', l, file=sys.stderr)
- try:
+ try:
print('TRY', module)
# XXX waiting for py3 to use print(..., flush=True)
sys.stdout.flush()
@@ -74,7 +74,7 @@ def check_imports(no_check=(), extra=(), skip_func=None, py_main=None):
import_times[str(module)] = delay
print('OK ', module, '{:.3f}s'.format(delay))
- except Exception as e:
+ except Exception as e:
print('FAIL:', module, e, file=sys.stderr)
print_backtrace_marked(sys.exc_info())
failed.append('{}: {}'.format(module, e))
@@ -92,8 +92,8 @@ def check_imports(no_check=(), extra=(), skip_func=None, py_main=None):
if failed:
raise ImportError('modules not imported:\n' + '\n'.join(failed))
-
-
+
+
test_imports = check_imports