allure-python
allure-python copied to clipboard
[feature] Easy way to get test_description, test_name, ecc.
Hello, this is a feature request. I need to get easily the test description, name, ecc inside a private function. I do not want to pass them as strings. I know that it is quite easy to set them
allure.dynamic.description("""blah blah""")
I asked on Stackoverflow how to get them and here there is the code:
import allure
from allure_commons._core import plugin_manager
from allure_pytest.listener import AllureListener
@allure.title("MYTITLE")
def test_A1(request):
allure.dynamic.description("""MYDESC""")
myfunct()
def myfunct():
plugin = next(p for p in plugin_manager.get_plugins() if isinstance(p, AllureListener))
testdescription = plugin.allure_logger.get_test(None).description
...
I would like to know whether in future versions it could be possibile to add a "getter" method. Thanks, Riccardo