You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When having tests with subtests, the calling of the s.T().Name() in the TearDownSubTest will return the parent test name and not the subtest that has been executed
Having this test executed will print the correct sub-test names:
=== RUN TestingSuite/TestWithSubtests
=== RUN TestingSuite/TestWithSubtests/my_subtest
my subtest -> TestSuite/TestHazelcastExternalSmartClientLoadBalancer/my_subtest
=== RUN TestingSuite/TestWithSubtests/my_subtest/my_sub_subtest
my sub subtest -> TestSuite/TestHazelcastExternalSmartClientLoadBalancer/my_subtest/my_sub_subtest
And I would expect that in the TearDownSubTest, the s.T().Name() should be consistent with these names. However, it always refers to the parent test name, i.e., TestingSuite/TestWithSubtests for the TestingSuite/TestWithSubtests/my_subtest, and TestingSuite/TestWithSubtests/my_subtest for the TestingSuite/TestWithSubtests/my_subtest/my_sub_subtest.
When having tests with subtests, the calling of the
s.T().Name()
in theTearDownSubTest
will return the parent test name and not the subtest that has been executedHaving this test executed will print the correct sub-test names:
Output:
And I would expect that in the
TearDownSubTest
, thes.T().Name()
should be consistent with these names. However, it always refers to the parent test name, i.e.,TestingSuite/TestWithSubtests
for theTestingSuite/TestWithSubtests/my_subtest
, andTestingSuite/TestWithSubtests/my_subtest
for theTestingSuite/TestWithSubtests/my_subtest/my_sub_subtest
.Output:
Environment:
Go 1.19
Testify 1.8.4
The text was updated successfully, but these errors were encountered: