How can I get currently running testcase name, while in the testsuite collection there are 16 testcases. Tests are executed sequentially (in the order of ad
unittest.TestCase._testMethodName
Example code:
import unittest
class BasicTests(unittest.TestCase):
def test_print(self):
print(self._testMethodName)
unittest.TestCase.shortDescription()
Returns a description of the test, or None if no description has been provided. The default implementation of this method returns the first line of the test method’s docstring, if available, or None.
unittest.TestCase.id()
Return a string identifying the specific test case. This is usually the full name of the test method, including the module and class name.
Hopefully one of those is useful for your needs.