diff options
author | akastornov <akastornov@yandex-team.ru> | 2022-02-10 16:46:03 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:03 +0300 |
commit | 8d3a5ed3a188a34167eaee54f1691ce5c9edf2f3 (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /library/python/pytest | |
parent | 3a2de774d91ca8d7325aaf81c200b1d2047725e6 (diff) | |
download | ydb-8d3a5ed3a188a34167eaee54f1691ce5c9edf2f3.tar.gz |
Restoring authorship annotation for <akastornov@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/python/pytest')
-rw-r--r-- | library/python/pytest/yatest_tools.py | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/library/python/pytest/yatest_tools.py b/library/python/pytest/yatest_tools.py index f9f54aab5a..6b8b896394 100644 --- a/library/python/pytest/yatest_tools.py +++ b/library/python/pytest/yatest_tools.py @@ -51,34 +51,34 @@ class Subtest(object): class SubtestInfo(object): - skipped_prefix = '[SKIPPED] ' - + skipped_prefix = '[SKIPPED] ' + @classmethod def from_str(cls, s): - if s.startswith(SubtestInfo.skipped_prefix): - s = s[len(SubtestInfo.skipped_prefix):] - skipped = True - - else: - skipped = False - - return SubtestInfo(*s.rsplit(TEST_SUBTEST_SEPARATOR, 1), skipped=skipped) - - def __init__(self, test, subtest="", skipped=False, **kwargs): + if s.startswith(SubtestInfo.skipped_prefix): + s = s[len(SubtestInfo.skipped_prefix):] + skipped = True + + else: + skipped = False + + return SubtestInfo(*s.rsplit(TEST_SUBTEST_SEPARATOR, 1), skipped=skipped) + + def __init__(self, test, subtest="", skipped=False, **kwargs): self.test = test self.subtest = subtest - self.skipped = skipped + self.skipped = skipped for key, value in kwargs.iteritems(): setattr(self, key, value) def __str__(self): - s = '' + s = '' + + if self.skipped: + s += SubtestInfo.skipped_prefix + + return s + TEST_SUBTEST_SEPARATOR.join([self.test, self.subtest]) - if self.skipped: - s += SubtestInfo.skipped_prefix - - return s + TEST_SUBTEST_SEPARATOR.join([self.test, self.subtest]) - def __repr__(self): return str(self) @@ -229,7 +229,7 @@ def escape_for_fnmatch(s): def get_python_cmd(opts=None, use_huge=True, suite=None): - if opts and getattr(opts, 'flags', {}).get("USE_ARCADIA_PYTHON") == "no": + if opts and getattr(opts, 'flags', {}).get("USE_ARCADIA_PYTHON") == "no": return ["python"] if suite and not suite._use_arcadia_python: return ["python"] |