aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorprettyboy <prettyboy@yandex-team.com>2022-10-24 01:26:55 +0300
committerprettyboy <prettyboy@yandex-team.com>2022-10-24 01:26:55 +0300
commitcf4b5923772bb1923ca91a09722730a8e5ba7726 (patch)
tree01573b44005091f71a8255cfb56d499a520dafd7
parent0e27829686e39af2c1e9e32270fd0f92e449ee16 (diff)
downloadydb-cf4b5923772bb1923ca91a09722730a8e5ba7726.tar.gz
[library/python/testing] Added yatest_common_standalone
-rw-r--r--library/python/testing/yatest_common/yatest/common/runtime.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/library/python/testing/yatest_common/yatest/common/runtime.py b/library/python/testing/yatest_common/yatest/common/runtime.py
index aaae9bb873..e377f9ac5f 100644
--- a/library/python/testing/yatest_common/yatest/common/runtime.py
+++ b/library/python/testing/yatest_common/yatest/common/runtime.py
@@ -12,6 +12,8 @@ _lock = threading.Lock()
_config = None
+_relaxed_runtime_allowed = False
+
class NoRuntimeFormed(NotImplementedError):
pass
@@ -60,6 +62,13 @@ def _is_binary():
return getattr(sys, 'is_standalone_binary', False)
+def _is_relaxed_runtime_allowed():
+ global _relaxed_runtime_allowed
+ if _relaxed_runtime_allowed:
+ return True
+ return _is_binary()
+
+
def default_arg0(func):
return default_arg(func, 0)
@@ -77,7 +86,7 @@ def default_arg(func, narg):
try:
return func(*args, **kw)
except NoRuntimeFormed:
- if not _is_binary():
+ if not _is_relaxed_runtime_allowed():
if len(args) > narg:
return args[narg]
return None
@@ -93,7 +102,7 @@ def default_value(value):
try:
return func(*args, **kw)
except NoRuntimeFormed:
- if not _is_binary():
+ if not _is_relaxed_runtime_allowed():
return value
raise
@@ -315,7 +324,7 @@ def gdb_path():
"""
Get path to the gdb
"""
- if not _is_binary():
+ if not _is_relaxed_runtime_allowed():
return "gdb"
return _get_ya_plugin_instance().gdb_path