aboutsummaryrefslogtreecommitdiffstats
path: root/library/python/testing/yatest_common/yatest/common/canonical.py
diff options
context:
space:
mode:
authorNikita Slyusarev <nslus@yandex-team.com>2022-02-10 16:46:52 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:52 +0300
commitcd77cecfc03a3eaf87816af28a33067c4f0cdb59 (patch)
tree1308e0bae862d52e0020d881fe758080437fe389 /library/python/testing/yatest_common/yatest/common/canonical.py
parentcdae02d225fb5b3afbb28990e79a7ac6c9125327 (diff)
downloadydb-cd77cecfc03a3eaf87816af28a33067c4f0cdb59.tar.gz
Restoring authorship annotation for Nikita Slyusarev <nslus@yandex-team.com>. Commit 1 of 2.
Diffstat (limited to 'library/python/testing/yatest_common/yatest/common/canonical.py')
-rw-r--r--library/python/testing/yatest_common/yatest/common/canonical.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/library/python/testing/yatest_common/yatest/common/canonical.py b/library/python/testing/yatest_common/yatest/common/canonical.py
index b6a136d3e9..443a5106ea 100644
--- a/library/python/testing/yatest_common/yatest/common/canonical.py
+++ b/library/python/testing/yatest_common/yatest/common/canonical.py
@@ -12,22 +12,22 @@ from . import path
yatest_logger = logging.getLogger("ya.test")
-def _copy(src, dst, universal_lines=False):
- if universal_lines:
- with open(dst, "wb") as f:
+def _copy(src, dst, universal_lines=False):
+ if universal_lines:
+ with open(dst, "wb") as f:
for line in open(src, "rbU"):
- f.write(line)
- return
- shutil.copy(src, dst)
-
-
+ f.write(line)
+ return
+ shutil.copy(src, dst)
+
+
def canonical_file(path, diff_tool=None, local=False, universal_lines=False, diff_file_name=None, diff_tool_timeout=None):
"""
Create canonical file that can be returned from a test
:param path: path to the file
:param diff_tool: custom diff tool to use for comparison with the canonical one, if None - default will be used
:param local: save file locally, otherwise move to sandbox
- :param universal_lines: normalize EOL
+ :param universal_lines: normalize EOL
:param diff_tool_timeout: timeout for running diff tool
:return: object that can be canonized
"""
@@ -36,7 +36,7 @@ def canonical_file(path, diff_tool=None, local=False, universal_lines=False, dif
tempdir = tempfile.mkdtemp(prefix="canon_tmp", dir=runtime.build_path())
safe_path = os.path.join(tempdir, os.path.basename(abs_path))
# if the created file is in output_path, we copy it, so that it will be available when the tests finishes
- _copy(path, safe_path, universal_lines=universal_lines)
+ _copy(path, safe_path, universal_lines=universal_lines)
if diff_tool:
if not isinstance(diff_tool, six.string_types):
try: # check if iterable