allure-framework / allure-framework/allure-python

[feature] Easy way to get test_description, test_name, ecc.

Open
#405 0 comments 0 reactions 0 assignees View on GitHub
task:new feature theme:pytest
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

Open the contributing guide

Research direction

Start by reading the public Allure API usage in the issue and the mentioned allure_pytest.listener.AllureListener and allure_commons._core.plugin_manager entry points. Trace how the current test metadata is accessed through allure_logger.get_test(None). Done means a supported getter exposes the test description, name, and related metadata without requiring callers to pass strings or inspect private internals.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.