fixtures do not record dependencies on other fixtures
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 64/100
Hướng nghiên cứu
Start in the allure-pytest listener's pytest_fixture_setup handling, where each fixture becomes a before entry in a container JSON file; the fixturedef handed to that hook exposes the fixture's argument names, which is exactly the dependency data missing from the output. Run the snippet from the issue to generate the allure/*.json files and confirm where the ordering information is lost. Check whether the shared Allure results schema needs a new field before a report can order the fixtures, then verify existing allure-pytest tests still pass.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Example:
import pytest
import allure
def func(n):
return n**2
@pytest.fixture()
def input_data():
with allure.step("Prepare input data"):
data = 5
return data
@pytest.fixture()
def compute_job(input_data):
with allure.step("Compute result"):
result = func(input_data)
return result
def test(compute_job):
with allure.step("Verify result"):
assert compute_job == 25
In this case, allure output json files contain no information that allows to deduce that the compute_job fixture depends on the input_data fixture.
Since they are fast, time ordering is not possible in most cases, since times are only recorded as integer seconds.
The allure report then shows the two fixtures in the wrong order:
Output json files:
allure/404698a7-6d47-46ee-951e-f1370a8ae247-container.json
{
"uuid": "a00b000b-e3bf-4599-b1fe-f99a4d9265fb",
"children": [
"cb8afcb4-86c9-4ec5-b7c1-def3c168afde"
],
"befores": [
{
"name": "compute_job",
"status": "passed",
"steps": [
{
"name": "Compute result",
"status": "passed",
"start": 1791292365354,
"stop": 1791292365354
}
],
"start": 1791292365354,
"stop": 1791292365354
}
],
"afters": [
{
"name": "compute_job::<lambda>",
"start": 1791292365355
}
],
"start": 1791292365354,
"stop": 1791292365355
}
allure/b068721b-3ae1-4959-9376-e840e763dbee-container.json
{
"uuid": "76f7b786-56ff-4b9b-9931-98c632f44c92",
"children": [
"cb8afcb4-86c9-4ec5-b7c1-def3c168afde"
],
"befores": [
{
"name": "input_data",
"status": "passed",
"steps": [
{
"name": "Prepare input data",
"status": "passed",
"start": 1791292365354,
"stop": 1791292365354
}
],
"start": 1791292365354,
"stop": 1791292365354
}
],
"afters": [
{
"name": "input_data::<lambda>",
"start": 1791292365355
}
],
"start": 1791292365354,
"stop": 1791292365355
}
allure/a16a30e1-80d0-4a0e-8dda-54c1cbbb5157-result.json
{
"name": "test",
"status": "passed",
"steps": [
{
"name": "Verify result",
"status": "passed",
"start": 1791292365355,
"stop": 1791292365355
}
],
"start": 1791292365355,
"stop": 1791292365355,
"uuid": "cb8afcb4-86c9-4ec5-b7c1-def3c168afde",
"historyId": "761acda85279d873545739563f5f4cb2",
"testCaseId": "761acda85279d873545739563f5f4cb2",
"fullName": "test_example#test",
"labels": [
{
"name": "suite",
"value": "test_example"
},
{
"name": "host",
"value": "max-desktop"
},
{
"name": "thread",
"value": "980504-MainThread"
},
{
"name": "framework",
"value": "pytest"
},
{
"name": "language",
"value": "cpython3"
},
{
"name": "package",
"value": "test_example"
}
],
"titlePath": [
"test_example.py"
]
}
- Ngôn ngữ chính
- Python
- Star
- 819
- Fork
- 261
- Merge trung bình
- 3 giờ 20 phút
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của allure-framework/allure-python
-
[allure-behave] Steps from tag-excluded scenarios bleed into the next matching scenario's result when hide_excluded=trueCó thể đã có người làm @liuyaohui666 đã nhận 48 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
-
Added CategoriesĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
-
Phantom <lambda> teardown entries with unknown status when using pytest 9.1+Có thể đã có người làm @Mohanad49 đã nhận 53 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
allure-framework/allure-python#918 · 1 reaction ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
allure-framework/allure-python#903 · 1 bình luận ·
-
Allure step placeholder fails when accessing dataclass attribute `data.name`Có thể đã có người làm @golikovichev đã nhận 158 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
Tất cả issue của allure-framework/allure-python
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
pyjanitor-devs/pyjanitor#1758 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug ready for review
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
odysseus-dev/odysseus#6641 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
happypawspillaro/happypaws#78 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
pydanty:is-working
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
pydantic/pydantic-ai#10020 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
stdlib type-bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
python/cpython#159044 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày