diff options
author | nalpp <nalpp@yandex-team.ru> | 2022-02-10 16:46:45 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:45 +0300 |
commit | 87f3eb38999df2d3c1cb77f8ffb9c52ec9c516fb (patch) | |
tree | f4ab0734eecf35b22f21952d1aa15496f267a6a3 /library | |
parent | 198698b9c1e18958addc9682fbfba4576d604757 (diff) | |
download | ydb-87f3eb38999df2d3c1cb77f8ffb9c52ec9c516fb.tar.gz |
Restoring authorship annotation for <nalpp@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library')
-rw-r--r-- | library/cpp/colorizer/ut/ya.make | 2 | ||||
-rw-r--r-- | library/cpp/dbg_output/ut/ya.make | 2 | ||||
-rw-r--r-- | library/cpp/dbg_output/ya.make | 2 | ||||
-rw-r--r-- | library/cpp/testing/unittest/ut/main.cpp | 2 | ||||
-rw-r--r-- | library/cpp/testing/unittest/ut/ya.make | 14 | ||||
-rw-r--r-- | library/python/filelock/__init__.py | 2 | ||||
-rw-r--r-- | library/python/pytest/yatest_tools.py | 52 | ||||
-rw-r--r-- | library/python/testing/yatest_common/yatest/common/process.py | 20 |
8 files changed, 48 insertions, 48 deletions
diff --git a/library/cpp/colorizer/ut/ya.make b/library/cpp/colorizer/ut/ya.make index 8a28c189af..e9ac941220 100644 --- a/library/cpp/colorizer/ut/ya.make +++ b/library/cpp/colorizer/ut/ya.make @@ -1,6 +1,6 @@ UNITTEST_FOR(library/cpp/colorizer) -OWNER(pg) +OWNER(pg) SRCS( colorizer_ut.cpp diff --git a/library/cpp/dbg_output/ut/ya.make b/library/cpp/dbg_output/ut/ya.make index 201601295d..108989de98 100644 --- a/library/cpp/dbg_output/ut/ya.make +++ b/library/cpp/dbg_output/ut/ya.make @@ -1,6 +1,6 @@ UNITTEST_FOR(library/cpp/dbg_output) -OWNER(pg) +OWNER(pg) SRCS( dbg_output_ut.cpp diff --git a/library/cpp/dbg_output/ya.make b/library/cpp/dbg_output/ya.make index 7d54108f93..6cc1d70ab1 100644 --- a/library/cpp/dbg_output/ya.make +++ b/library/cpp/dbg_output/ya.make @@ -1,6 +1,6 @@ LIBRARY() -OWNER(pg) +OWNER(pg) PEERDIR( library/cpp/colorizer diff --git a/library/cpp/testing/unittest/ut/main.cpp b/library/cpp/testing/unittest/ut/main.cpp index e303e21e30..9541e8d089 100644 --- a/library/cpp/testing/unittest/ut/main.cpp +++ b/library/cpp/testing/unittest/ut/main.cpp @@ -6,7 +6,7 @@ #include <util/network/sock.h> #include <util/system/env.h> #include <util/system/fs.h> - + TEST(GTest, Test1) { UNIT_ASSERT_EQUAL(1, 1); } diff --git a/library/cpp/testing/unittest/ut/ya.make b/library/cpp/testing/unittest/ut/ya.make index 6d4c0959cc..5e3f4de559 100644 --- a/library/cpp/testing/unittest/ut/ya.make +++ b/library/cpp/testing/unittest/ut/ya.make @@ -1,10 +1,10 @@ UNITTEST_FOR(library/cpp/testing/unittest) - + OWNER(snowball) - -SRCS( - main.cpp + +SRCS( + main.cpp registar_ut.cpp -) - -END() +) + +END() diff --git a/library/python/filelock/__init__.py b/library/python/filelock/__init__.py index f81ff67f37..7325b1d398 100644 --- a/library/python/filelock/__init__.py +++ b/library/python/filelock/__init__.py @@ -30,7 +30,7 @@ class AbstractFileLock(object): def __enter__(self): self.acquire() return self - + def __exit__(self, type, value, traceback): self.release() diff --git a/library/python/pytest/yatest_tools.py b/library/python/pytest/yatest_tools.py index 6b8b896394..0a822f3c5d 100644 --- a/library/python/pytest/yatest_tools.py +++ b/library/python/pytest/yatest_tools.py @@ -10,24 +10,24 @@ import sys import yatest_lib.tools -class Subtest(object): +class Subtest(object): def __init__(self, name, test_name, status, comment, elapsed, result=None, test_type=None, logs=None, cwd=None, metrics=None): self._name = name self._test_name = test_name - self.status = status - self.elapsed = elapsed - self.comment = comment + self.status = status + self.elapsed = elapsed + self.comment = comment self.result = result self.test_type = test_type self.logs = logs or {} self.cwd = cwd self.metrics = metrics - + def __eq__(self, other): if not isinstance(other, Subtest): return False return self.name == other.name and self.test_name == other.test_name - + def __str__(self): return yatest_lib.tools.to_utf8(unicode(self)) @@ -83,7 +83,7 @@ class SubtestInfo(object): return str(self) -class Status(object): +class Status(object): GOOD, XFAIL, FAIL, XPASS, MISSING, CRASHED, TIMEOUT = range(7) SKIPPED = -100 NOT_LAUNCHED = -200 @@ -93,16 +93,16 @@ class Status(object): 'skipped': SKIPPED, 'flaky': FLAKY, 'not_launched': NOT_LAUNCHED, 'timeout': TIMEOUT, 'diff': CANON_DIFF} TO_STR = {GOOD: 'good', FAIL: 'fail', XFAIL: 'xfail', XPASS: 'xpass', MISSING: 'missing', CRASHED: 'crashed', SKIPPED: 'skipped', FLAKY: 'flaky', NOT_LAUNCHED: 'not_launched', TIMEOUT: 'timeout', CANON_DIFF: 'diff'} - - -class Test(object): + + +class Test(object): def __init__(self, name, path, status=None, comment=None, subtests=None): - self.name = name - self.path = path + self.name = name + self.path = path self.status = status self.comment = comment self.subtests = subtests or [] - + def __eq__(self, other): if not isinstance(other, Test): return False @@ -114,19 +114,19 @@ class Test(object): def __repr__(self): return str(self) - def add_subtest(self, subtest): - self.subtests.append(subtest) - - def setup_status(self, status, comment): - self.status = Status.BY_NAME[status or 'good'] - if len(self.subtests) != 0: - self.status = max(self.status, max(s.status for s in self.subtests)) - self.comment = comment - - def subtests_by_status(self, status): - return [x.status for x in self.subtests].count(status) - - + def add_subtest(self, subtest): + self.subtests.append(subtest) + + def setup_status(self, status, comment): + self.status = Status.BY_NAME[status or 'good'] + if len(self.subtests) != 0: + self.status = max(self.status, max(s.status for s in self.subtests)) + self.comment = comment + + def subtests_by_status(self, status): + return [x.status for x in self.subtests].count(status) + + class NoMd5FileException(Exception): pass diff --git a/library/python/testing/yatest_common/yatest/common/process.py b/library/python/testing/yatest_common/yatest/common/process.py index a8bcc21f51..62afaedb9d 100644 --- a/library/python/testing/yatest_common/yatest/common/process.py +++ b/library/python/testing/yatest_common/yatest/common/process.py @@ -24,22 +24,22 @@ from . import path from . import environment -MAX_OUT_LEN = 1000 * 1000 # 1 mb +MAX_OUT_LEN = 1000 * 1000 # 1 mb MAX_MESSAGE_LEN = 1500 SANITIZER_ERROR_PATTERN = br": ([A-Z][\w]+Sanitizer)" GLIBC_PATTERN = re.compile(r"\S+@GLIBC_([0-9.]+)") yatest_logger = logging.getLogger("ya.test") -def truncate(s, size): - if s is None: - return None - elif len(s) <= size: - return s - else: +def truncate(s, size): + if s is None: + return None + elif len(s) <= size: + return s + else: return (b'...' if isinstance(s, bytes) else '...') + s[-(size - 3):] - - + + def get_command_name(command): return os.path.basename(command.split()[0] if isinstance(command, six.string_types) else command[0]) @@ -623,7 +623,7 @@ def wait_for(check_function, timeout, fail_message="", sleep_time=1.0, on_check_ message = "{} second(s) wait timeout has expired".format(timeout) if fail_message: message += ": {}".format(fail_message) - raise TimeoutError(truncate(message, MAX_MESSAGE_LEN)) + raise TimeoutError(truncate(message, MAX_MESSAGE_LEN)) def _kill_process_tree(process_pid, target_pid_signal=None): |