From ca35c8446fa4073ba41f651e21601e39b99b3035 Mon Sep 17 00:00:00 2001
From: anterpin <anterpin@yandex-team.com>
Date: Thu, 3 Aug 2023 17:42:57 +0300
Subject: Add set_metric_value, so non-pytest tests could write metrics

---
 .../testing/yatest_common/yatest/common/runtime.py | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

(limited to 'library/python/testing')

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():
     """
-- 
cgit v1.2.3