aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/testing/unittest/pytests/test_subject/tests.cpp
diff options
context:
space:
mode:
authorarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-04-26 13:38:24 +0300
committerarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-04-26 13:38:24 +0300
commitd5542c891803641fb11f2edf0d71e6004a5e9c38 (patch)
tree592fd52d5412775f103fab3beb0083c08de7837f /library/cpp/testing/unittest/pytests/test_subject/tests.cpp
parente42e29335e2001970f95535e7557d5c27519f29f (diff)
downloadydb-d5542c891803641fb11f2edf0d71e6004a5e9c38.tar.gz
intermediate changes
ref:ba3b994bce107b5d5ed74af8bebe6df02576505a
Diffstat (limited to 'library/cpp/testing/unittest/pytests/test_subject/tests.cpp')
-rw-r--r--library/cpp/testing/unittest/pytests/test_subject/tests.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/library/cpp/testing/unittest/pytests/test_subject/tests.cpp b/library/cpp/testing/unittest/pytests/test_subject/tests.cpp
new file mode 100644
index 0000000000..677e5130ed
--- /dev/null
+++ b/library/cpp/testing/unittest/pytests/test_subject/tests.cpp
@@ -0,0 +1,34 @@
+#include <library/cpp/testing/unittest/registar.h>
+
+namespace NSubjectTests {
+ class TAlwaysTearDownFixture : public NUnitTest::TBaseFixture {
+ public:
+ void TearDown(NUnitTest::TTestContext&) override {
+ Cerr << Name_ << ": TearDown is ran" << Endl;
+ }
+ };
+
+ class TAlwaysTearDownSetUpThrowsFixture : public NUnitTest::TBaseFixture {
+ public:
+ void SetUp(NUnitTest::TTestContext&) override {
+ ythrow yexception() << "hope this won't skip teardown";
+ }
+
+ void TearDown(NUnitTest::TTestContext&) override {
+ Cerr << Name_ << ": TearDown is ran" << Endl;
+ }
+ };
+
+ Y_UNIT_TEST_SUITE(TestsAlwaysTearDown) {
+ Y_UNIT_TEST_F(TestFail, TAlwaysTearDownFixture) {
+ UNIT_ASSERT(false);
+ }
+
+ Y_UNIT_TEST_F(TestThrow, TAlwaysTearDownFixture) {
+ ythrow yexception() << "hope this won't skip teardown";
+ }
+
+ Y_UNIT_TEST_F(TestSetUpThrows, TAlwaysTearDownSetUpThrowsFixture) {
+ }
+ }
+}