diff options
author | spreis <spreis@yandex-team.ru> | 2022-02-10 16:47:13 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:13 +0300 |
commit | b49848d6e361b76904f094b7d5e10d6edea75afe (patch) | |
tree | 9814fbd1c3effac9b8377c5d604b367b14e2db55 /contrib/libs/python/ut | |
parent | bcd1126cbd5d445cd0665d295198aa39c6ab8cbe (diff) | |
download | ydb-b49848d6e361b76904f094b7d5e10d6edea75afe.tar.gz |
Restoring authorship annotation for <spreis@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/python/ut')
-rw-r--r-- | contrib/libs/python/ut/lib/test.cpp | 40 | ||||
-rw-r--r-- | contrib/libs/python/ut/lib/test.h | 14 | ||||
-rw-r--r-- | contrib/libs/python/ut/lib/ya.make | 12 | ||||
-rw-r--r-- | contrib/libs/python/ut/py2/use.cpp | 18 | ||||
-rw-r--r-- | contrib/libs/python/ut/py2/ya.make | 18 | ||||
-rw-r--r-- | contrib/libs/python/ut/py3/use.cpp | 18 | ||||
-rw-r--r-- | contrib/libs/python/ut/py3/ya.make | 20 | ||||
-rw-r--r-- | contrib/libs/python/ut/ya.make | 14 |
8 files changed, 77 insertions, 77 deletions
diff --git a/contrib/libs/python/ut/lib/test.cpp b/contrib/libs/python/ut/lib/test.cpp index 824b7460e1..e3aabc8889 100644 --- a/contrib/libs/python/ut/lib/test.cpp +++ b/contrib/libs/python/ut/lib/test.cpp @@ -1,21 +1,21 @@ -#include "test.h" - -#include <Python.h> +#include "test.h" + +#include <Python.h> #include <library/cpp/testing/unittest/registar.h> - -TTestPyInvoker::TTestPyInvoker() {} - -const char* TTestPyInvoker::GetVersion() { - Py_Initialize(); - - auto* module = PyImport_ImportModule("sys"); - UNIT_ASSERT(module != nullptr); - - auto* versionObj = PyObject_GetAttrString(module, "version"); - if (versionObj == nullptr) { - Py_DECREF(module); - UNIT_ASSERT(versionObj != nullptr); - } - - return Py_GetVersion(); -} + +TTestPyInvoker::TTestPyInvoker() {} + +const char* TTestPyInvoker::GetVersion() { + Py_Initialize(); + + auto* module = PyImport_ImportModule("sys"); + UNIT_ASSERT(module != nullptr); + + auto* versionObj = PyObject_GetAttrString(module, "version"); + if (versionObj == nullptr) { + Py_DECREF(module); + UNIT_ASSERT(versionObj != nullptr); + } + + return Py_GetVersion(); +} diff --git a/contrib/libs/python/ut/lib/test.h b/contrib/libs/python/ut/lib/test.h index 4bdbe672ac..1bf824ebea 100644 --- a/contrib/libs/python/ut/lib/test.h +++ b/contrib/libs/python/ut/lib/test.h @@ -1,7 +1,7 @@ -#pragma once - -class TTestPyInvoker { -public: - TTestPyInvoker(); - const char* GetVersion(); -}; +#pragma once + +class TTestPyInvoker { +public: + TTestPyInvoker(); + const char* GetVersion(); +}; diff --git a/contrib/libs/python/ut/lib/ya.make b/contrib/libs/python/ut/lib/ya.make index a67c3e254e..cfa0aaa612 100644 --- a/contrib/libs/python/ut/lib/ya.make +++ b/contrib/libs/python/ut/lib/ya.make @@ -1,17 +1,17 @@ -OWNER(spreis) - -PY23_LIBRARY() +OWNER(spreis) + +PY23_LIBRARY() WITHOUT_LICENSE_TEXTS() LICENSE(YandexOpen) -PEERDIR( +PEERDIR( library/cpp/testing/unittest -) +) SRCS( test.cpp ) -END() +END() diff --git a/contrib/libs/python/ut/py2/use.cpp b/contrib/libs/python/ut/py2/use.cpp index 853fb452dc..a4a2c8d9bb 100644 --- a/contrib/libs/python/ut/py2/use.cpp +++ b/contrib/libs/python/ut/py2/use.cpp @@ -1,10 +1,10 @@ -#include <contrib/libs/python/ut/lib/test.h> +#include <contrib/libs/python/ut/lib/test.h> #include <library/cpp/testing/unittest/registar.h> - -Y_UNIT_TEST_SUITE(TestPy3Binding) { - Y_UNIT_TEST(version) { - TTestPyInvoker invoker; - UNIT_ASSERT_EQUAL(invoker.GetVersion()[0], '2'); - } -} - + +Y_UNIT_TEST_SUITE(TestPy3Binding) { + Y_UNIT_TEST(version) { + TTestPyInvoker invoker; + UNIT_ASSERT_EQUAL(invoker.GetVersion()[0], '2'); + } +} + diff --git a/contrib/libs/python/ut/py2/ya.make b/contrib/libs/python/ut/py2/ya.make index 3962a7664e..9c5c824761 100644 --- a/contrib/libs/python/ut/py2/ya.make +++ b/contrib/libs/python/ut/py2/ya.make @@ -1,9 +1,9 @@ -OWNER(spreis) - -UNITTEST() -SRCS(use.cpp) - -PEERDIR( - contrib/libs/python/ut/lib -) -END() +OWNER(spreis) + +UNITTEST() +SRCS(use.cpp) + +PEERDIR( + contrib/libs/python/ut/lib +) +END() diff --git a/contrib/libs/python/ut/py3/use.cpp b/contrib/libs/python/ut/py3/use.cpp index e532ca89e7..8a2531bcc1 100644 --- a/contrib/libs/python/ut/py3/use.cpp +++ b/contrib/libs/python/ut/py3/use.cpp @@ -1,10 +1,10 @@ -#include <contrib/libs/python/ut/lib/test.h> +#include <contrib/libs/python/ut/lib/test.h> #include <library/cpp/testing/unittest/registar.h> - -Y_UNIT_TEST_SUITE(TestPy3Binding) { - Y_UNIT_TEST(version) { - TTestPyInvoker invoker; - UNIT_ASSERT_EQUAL(invoker.GetVersion()[0], '3'); - } -} - + +Y_UNIT_TEST_SUITE(TestPy3Binding) { + Y_UNIT_TEST(version) { + TTestPyInvoker invoker; + UNIT_ASSERT_EQUAL(invoker.GetVersion()[0], '3'); + } +} + diff --git a/contrib/libs/python/ut/py3/ya.make b/contrib/libs/python/ut/py3/ya.make index af8407938c..df6d4fe767 100644 --- a/contrib/libs/python/ut/py3/ya.make +++ b/contrib/libs/python/ut/py3/ya.make @@ -1,10 +1,10 @@ -OWNER(spreis) - -UNITTEST() -USE_PYTHON3() -SRCS(use.cpp) - -PEERDIR( - contrib/libs/python/ut/lib -) -END() +OWNER(spreis) + +UNITTEST() +USE_PYTHON3() +SRCS(use.cpp) + +PEERDIR( + contrib/libs/python/ut/lib +) +END() diff --git a/contrib/libs/python/ut/ya.make b/contrib/libs/python/ut/ya.make index 5fe3576e06..4fea35153a 100644 --- a/contrib/libs/python/ut/ya.make +++ b/contrib/libs/python/ut/ya.make @@ -1,7 +1,7 @@ -OWNER(spreis) - -RECURSE( - lib - py2 - py3 -)
\ No newline at end of file +OWNER(spreis) + +RECURSE( + lib + py2 + py3 +)
\ No newline at end of file |