allure-framework / allure-framework/allure-python
[feature] Easy way to get test_description, test_name, ecc.
- Dominant language
- Python
- Stars
- 814
- Forks
- 260
- PR merge metrics
- No merged PRs in 30d
Description
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 ](https://stackoverflow.com/questions/57047461/get-dynamic-test-description-in-allure-pytest )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
Contributor guide
Assessment
This issue has not been assessed yet.