summaryrefslogtreecommitdiffstats
path: root/library/python/testing
diff options
context:
space:
mode:
authorrobot-piglet <[email protected]>2025-11-05 16:26:01 +0300
committerrobot-piglet <[email protected]>2025-11-05 17:00:18 +0300
commit21e77ed3bcc80f6fa0dc578cbd22e5f52c234299 (patch)
treee2d709c661b9c6ab9477281e6212bc4400e8fcb9 /library/python/testing
parentc56efcec21ea9c6e76e3d93e40aedcbffb7d0a8a (diff)
Intermediate changes
commit_hash:27c113073be129386081bdae5a54d7b3d5cd6221
Diffstat (limited to 'library/python/testing')
-rw-r--r--library/python/testing/recipe/__init__.py4
-rw-r--r--library/python/testing/yatest_lib/ya.py8
2 files changed, 10 insertions, 2 deletions
diff --git a/library/python/testing/recipe/__init__.py b/library/python/testing/recipe/__init__.py
index 0d90ea410aa..539001249f4 100644
--- a/library/python/testing/recipe/__init__.py
+++ b/library/python/testing/recipe/__init__.py
@@ -83,6 +83,10 @@ def set_env(key, value):
f.write("\n")
+def del_env(key):
+ set_env(key, None)
+
+
def tty():
if os.isatty(1):
return
diff --git a/library/python/testing/yatest_lib/ya.py b/library/python/testing/yatest_lib/ya.py
index f2b3dcc411c..3889e7e5dee 100644
--- a/library/python/testing/yatest_lib/ya.py
+++ b/library/python/testing/yatest_lib/ya.py
@@ -121,8 +121,12 @@ class Ya(object):
for ljson in file.readlines():
variable = json.loads(ljson)
for key, value in six.iteritems(variable):
- os.environ[key] = str(value)
- var_list.append(key)
+ if value is not None:
+ os.environ[key] = str(value)
+ var_list.append(key)
+ else:
+ if key in os.environ:
+ del os.environ[key]
yatest_logger.debug("Variables loaded: %s", var_list)
@property