allure-framework / allure-framework/allure-python
[feature] Easy way to get test_description, test_name, ecc.
- Ngôn ngữ chính
- Python
- Star
- 814
- Fork
- 260
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách đọc cách sử dụng Allure API công khai trong issue và các entry point được đề cập là allure_pytest.listener.AllureListener và allure_commons._core.plugin_manager. Truy vết cách truy cập metadata của test hiện tại thông qua allure_logger.get_test(None). Hoàn thành khi một getter được hỗ trợ cung cấp description, name và metadata liên quan của test mà không yêu cầu bên gọi truyền các chuỗi hoặc kiểm tra các internals riêng tư.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- testing
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 30/100