diff options
author | robot-piglet <[email protected]> | 2025-08-28 10:42:11 +0300 |
---|---|---|
committer | robot-piglet <[email protected]> | 2025-08-28 10:55:38 +0300 |
commit | b8d1a9799cb775bca70c28659d06af534fef2451 (patch) | |
tree | 9381fa9a70641e6017280d0c5e40780cd5269491 | |
parent | aca3df9166eb754cec4dbf8cbd2b0c2119d8e190 (diff) |
Intermediate changes
commit_hash:7cb1b858db9e1e66d33dcb3808a3ad884bd1c5b5
-rw-r--r-- | library/python/pytest/plugins/ya.py | 2 | ||||
-rw-r--r-- | library/python/testing/yatest_lib/ya.make | 1 | ||||
-rw-r--r-- | library/python/testing/yatest_lib/ya.py | 7 |
3 files changed, 8 insertions, 2 deletions
diff --git a/library/python/pytest/plugins/ya.py b/library/python/pytest/plugins/ya.py index 70ea29ddbfc..9afb02185c7 100644 --- a/library/python/pytest/plugins/ya.py +++ b/library/python/pytest/plugins/ya.py @@ -213,7 +213,6 @@ def pytest_configure(config): config.suite_metrics = {} config.configure_timestamp = time.time() context = { - "project_path": config.option.project_path, "test_stderr": config.option.test_stderr, "test_debug": config.option.test_debug, "build_type": config.option.build_type, @@ -237,6 +236,7 @@ def pytest_configure(config): config.option.valgrind_path, config.option.gdb_path, config.option.data_root, + project_path=config.option.project_path, ) config.option.test_log_level = { "critical": logging.CRITICAL, diff --git a/library/python/testing/yatest_lib/ya.make b/library/python/testing/yatest_lib/ya.make index 79442b8faf1..90273c0856e 100644 --- a/library/python/testing/yatest_lib/ya.make +++ b/library/python/testing/yatest_lib/ya.make @@ -15,6 +15,7 @@ PEERDIR( IF(PYTHON2) PEERDIR( + library/python/strings contrib/deprecated/python/enum34 ) ENDIF() diff --git a/library/python/testing/yatest_lib/ya.py b/library/python/testing/yatest_lib/ya.py index 89a82b55a6d..f2b3dcc411c 100644 --- a/library/python/testing/yatest_lib/ya.py +++ b/library/python/testing/yatest_lib/ya.py @@ -7,6 +7,7 @@ import six from .tools import to_str from .external import ExternalDataInfo + TESTING_OUT_DIR_NAME = "testing_out_stuff" # XXX import from test.const yatest_logger = logging.getLogger("ya.test") @@ -40,11 +41,15 @@ class Ya(object): gdb_path=None, data_root=None, env_file=None, + project_path=None, ): context_file_path = os.environ.get("YA_TEST_CONTEXT_FILE", None) if context_file_path: with open(context_file_path, 'r') as afile: test_context = json.load(afile) + if six.PY2: + from library.python.strings import ensure_str_deep + test_context = ensure_str_deep(test_context) context_runtime = test_context["runtime"] context_internal = test_context.get("internal", {}) context_build = test_context.get("build", {}) @@ -89,7 +94,7 @@ class Ya(object): self._test_params.update(dict(x.split('=', 1) for x in test_params)) self._test_params.update(context_runtime.get("test_params", {})) - self._context["project_path"] = context_runtime.get("project_path") + self._context["project_path"] = context_runtime.get("project_path") or project_path self._context["modulo"] = context_runtime.get("split_count", 1) self._context["modulo_index"] = context_runtime.get("split_index", 0) self._context["work_path"] = to_str(context_runtime.get("work_path")) |