diff options
author | robot-ydb-importer <robot-ydb-importer@yandex-team.com> | 2024-11-22 16:22:45 +0300 |
---|---|---|
committer | robot-ydb-importer <robot-ydb-importer@yandex-team.com> | 2024-11-22 16:37:54 +0300 |
commit | e2791d7cb5f6c16065070c3e36286399908c3f56 (patch) | |
tree | 3fe608c5d15b25f183591f075dee49bfd6a83dde /library/python/cpp_test | |
parent | 145d1a017c8b4a1d1d2d900d87df267373c7479e (diff) | |
download | ydb-e2791d7cb5f6c16065070c3e36286399908c3f56.tar.gz |
YDB Import 625
commit_hash:bbf24592c367fa158fbc53e041fe367374d0750e
Diffstat (limited to 'library/python/cpp_test')
-rw-r--r-- | library/python/cpp_test/conftest.py | 18 | ||||
-rw-r--r-- | library/python/cpp_test/test_cpp.py | 37 | ||||
-rw-r--r-- | library/python/cpp_test/ya.make | 15 |
3 files changed, 0 insertions, 70 deletions
diff --git a/library/python/cpp_test/conftest.py b/library/python/cpp_test/conftest.py deleted file mode 100644 index 5e9a0fbf9a9..00000000000 --- a/library/python/cpp_test/conftest.py +++ /dev/null @@ -1,18 +0,0 @@ -import difflib - - -def iter_diff(fr, to): - for line in difflib.unified_diff(fr.splitlines(), to.splitlines(), fromfile='L', tofile='R'): - line = line.rstrip('\n') - - if line: - if line[0] == '-': - line = '[[bad]]' + line + '[[rst]]' - elif line[0] == '+': - line = '[[good]]' + line + '[[rst]]' - - yield line - - -def pytest_assertrepr_compare(op, left, right): - return ['failed, show diff'] + list(iter_diff(left, right)) diff --git a/library/python/cpp_test/test_cpp.py b/library/python/cpp_test/test_cpp.py deleted file mode 100644 index b4c78f82716..00000000000 --- a/library/python/cpp_test/test_cpp.py +++ /dev/null @@ -1,37 +0,0 @@ -import json -import os -import subprocess - -import pytest -import yaml -import yatest - -from library.python.testing.style import rules -import library.python.resource as lpr - - -# keep in sync with the logic in https://a.yandex-team.ru/arcadia/devtools/ya/handlers/style/cpp_style.py?rev=r12543375#L21 -STYLE_CONFIG_JSON = json.dumps(yaml.safe_load(lpr.find('resfs/file/config.clang-format'))) - -RES_FILE_PREFIX = '/cpp_style/files/' -CHECKED_PATHS = list(lpr.iterkeys(RES_FILE_PREFIX, strip_prefix=True)) - - -def check_style(filename, actual_source): - clang_format_binary = yatest.common.binary_path('contrib/libs/clang16/tools/clang-format/clang-format') - config = STYLE_CONFIG_JSON - - command = [clang_format_binary, '-assume-filename=' + filename, '-style=' + config] - styled_source = subprocess.check_output(command, input=actual_source) - - assert actual_source.decode() == styled_source.decode() - - -@pytest.mark.parametrize('path', CHECKED_PATHS) -def test_cpp_style(path): - data = lpr.find(RES_FILE_PREFIX + path) - skip_reason = rules.get_skip_reason(path, data, skip_links=False) - if skip_reason: - raise pytest.skip("style check is omitted: {}".format(skip_reason)) - else: - check_style(os.path.basename(path), data) diff --git a/library/python/cpp_test/ya.make b/library/python/cpp_test/ya.make deleted file mode 100644 index 9fbc9212987..00000000000 --- a/library/python/cpp_test/ya.make +++ /dev/null @@ -1,15 +0,0 @@ -PY3_LIBRARY() - -PEERDIR( - build/config/tests/cpp_style - contrib/python/PyYAML - library/python/resource - library/python/testing/style -) - -TEST_SRCS( - conftest.py - test_cpp.py -) - -END() |