aboutsummaryrefslogtreecommitdiffstats
path: root/library/python/testing
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.ru>2022-02-10 16:44:30 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:44:30 +0300
commit2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch)
tree012bb94d777798f1f56ac1cec429509766d05181 /library/python/testing
parent6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff)
downloadydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/python/testing')
-rw-r--r--library/python/testing/import_test/import_test.py8
-rw-r--r--library/python/testing/yatest_common/yatest/common/process.py4
-rw-r--r--library/python/testing/yatest_common/yatest/common/runtime.py6
-rw-r--r--library/python/testing/yatest_lib/ya.py22
4 files changed, 20 insertions, 20 deletions
diff --git a/library/python/testing/import_test/import_test.py b/library/python/testing/import_test/import_test.py
index 3e3b7234ef..5dd0c49306 100644
--- a/library/python/testing/import_test/import_test.py
+++ b/library/python/testing/import_test/import_test.py
@@ -101,16 +101,16 @@ def main():
skip_names = sys.argv[1:]
os.environ['Y_PYTHON_IMPORT_TEST'] = ''
-
- # We should initialize Django before importing any applications
- if os.getenv('DJANGO_SETTINGS_MODULE'):
+
+ # We should initialize Django before importing any applications
+ if os.getenv('DJANGO_SETTINGS_MODULE'):
try:
import django
except ImportError:
pass
else:
django.setup()
-
+
py_main = __res.find('PY_MAIN')
if py_main:
diff --git a/library/python/testing/yatest_common/yatest/common/process.py b/library/python/testing/yatest_common/yatest/common/process.py
index a8bcc21f51..0c2dbb08a0 100644
--- a/library/python/testing/yatest_common/yatest/common/process.py
+++ b/library/python/testing/yatest_common/yatest/common/process.py
@@ -544,8 +544,8 @@ def _get_command_output_file(cmd, ext):
try:
# if execution is performed from test, save out / err to the test logs dir
import yatest.common
- import library.python.pytest.plugins.ya
- if getattr(library.python.pytest.plugins.ya, 'pytest_config', None) is None:
+ import library.python.pytest.plugins.ya
+ if getattr(library.python.pytest.plugins.ya, 'pytest_config', None) is None:
raise ImportError("not in test")
filename = path.get_unique_file_path(yatest.common.output_path(), filename)
yatest_logger.debug("Command %s will be placed to %s", ext, os.path.basename(filename))
diff --git a/library/python/testing/yatest_common/yatest/common/runtime.py b/library/python/testing/yatest_common/yatest/common/runtime.py
index e55e193446..e40be347df 100644
--- a/library/python/testing/yatest_common/yatest/common/runtime.py
+++ b/library/python/testing/yatest_common/yatest/common/runtime.py
@@ -12,9 +12,9 @@ _lock = threading.Lock()
def _get_ya_config():
try:
- import library.python.pytest.plugins.ya as ya_plugin
- if ya_plugin.pytest_config is not None:
- return ya_plugin.pytest_config
+ import library.python.pytest.plugins.ya as ya_plugin
+ if ya_plugin.pytest_config is not None:
+ return ya_plugin.pytest_config
import pytest
return pytest.config
except (ImportError, AttributeError):
diff --git a/library/python/testing/yatest_lib/ya.py b/library/python/testing/yatest_lib/ya.py
index c13b58a19f..9b077f5ace 100644
--- a/library/python/testing/yatest_lib/ya.py
+++ b/library/python/testing/yatest_lib/ya.py
@@ -218,22 +218,22 @@ class Ya(object):
assert self._test_item_node_id
return self._test_item_node_id
- @property
- def pytest_config(self):
- if not hasattr(self, "_pytest_config"):
- import library.python.pytest.plugins.ya as ya_plugin
- self._pytest_config = ya_plugin.pytest_config
- return self._pytest_config
-
+ @property
+ def pytest_config(self):
+ if not hasattr(self, "_pytest_config"):
+ import library.python.pytest.plugins.ya as ya_plugin
+ self._pytest_config = ya_plugin.pytest_config
+ return self._pytest_config
+
def set_metric_value(self, name, val):
node_id = self.get_test_item_node_id()
- if node_id not in self.pytest_config.test_metrics:
- self.pytest_config.test_metrics[node_id] = {}
+ if node_id not in self.pytest_config.test_metrics:
+ self.pytest_config.test_metrics[node_id] = {}
- self.pytest_config.test_metrics[node_id][name] = val
+ self.pytest_config.test_metrics[node_id][name] = val
def get_metric_value(self, name, default=None):
- res = self.pytest_config.test_metrics.get(self.get_test_item_node_id(), {}).get(name)
+ res = self.pytest_config.test_metrics.get(self.get_test_item_node_id(), {}).get(name)
if res is None:
return default
return res