aboutsummaryrefslogtreecommitdiffstats
path: root/library/python/testing
diff options
context:
space:
mode:
authoranterpin <anterpin@yandex-team.com>2023-08-03 17:42:57 +0300
committeranterpin <anterpin@yandex-team.com>2023-08-03 17:42:57 +0300
commitca35c8446fa4073ba41f651e21601e39b99b3035 (patch)
treea2212077d4823ed435c58fa67e8a11af77715958 /library/python/testing
parent00834fe4a07711381989e47cb4cb12fe3be7fc36 (diff)
downloadydb-ca35c8446fa4073ba41f651e21601e39b99b3035.tar.gz
Add set_metric_value, so non-pytest tests could write metrics
Diffstat (limited to 'library/python/testing')
-rw-r--r--library/python/testing/yatest_common/yatest/common/runtime.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/library/python/testing/yatest_common/yatest/common/runtime.py b/library/python/testing/yatest_common/yatest/common/runtime.py
index af9155d8e8..b43666b596 100644
--- a/library/python/testing/yatest_common/yatest/common/runtime.py
+++ b/library/python/testing/yatest_common/yatest/common/runtime.py
@@ -287,6 +287,28 @@ def get_param(key, default=None):
return _get_ya_plugin_instance().get_param(key, default)
+def set_metric_value(name, val):
+ """
+ Use this method only when your test environment does not support pytest fixtures,
+ otherwise you should prefer using https://docs.yandex-team.ru/ya-make/manual/tests/#python
+ :param name: name
+ :param val: value
+ """
+ _get_ya_plugin_instance().set_metric_value(name, val)
+
+
+@default_arg1
+def get_metric_value(name, default=None):
+ """
+ Use this method only when your test environment does not support pytest fixtures,
+ otherwise you should prefer using https://docs.yandex-team.ru/ya-make/manual/tests/#python
+ :param name: name
+ :param default: default
+ :return: parameter value or the default
+ """
+ return _get_ya_plugin_instance().get_metric_value(name, default)
+
+
@default_value(lambda _: {})
def get_param_dict_copy():
"""