allure-framework / allure-framework/allure-python

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

オープン
#405 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
task:new feature theme:pytest
主要言語
Python
スター
814
フォーク
260
PR マージ指標
30日以内にマージされた PR はありません

説明

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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず、issue にある公開 Allure API の使用方法と、言及されているエントリーポイント allure_pytest.listener.AllureListener および allure_commons._core.plugin_manager を読みます。現在のテストメタデータが allure_logger.get_test(None) を介してどのように取得されているかを追跡します。呼び出し側が文字列を渡したり、private な内部実装を調べたりすることなく、サポートされた getter によってテストの説明、名前、および関連するメタデータが公開されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
testing
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
30/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。