Rewrite pytest-bdd to use hooks and marks
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Bắt đầu bằng cách đọc issue #296 và tài liệu pytest được liên kết về marks và hooks, sau đó so sánh API được đề xuất với các decorator pytest-bdd hiện tại được nêu trong issue. Xác định xem bản viết lại có thể giữ nguyên các tính năng hiện có hay không và quyết định vai trò của mark @scenario; công việc được xem là hoàn tất khi có một thiết kế và kế hoạch triển khai đã được thống nhất.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Following the suggestion from issue #296, I will try to re-implement pytest-bdd to use marks and hooks.
I imagine an API that will look like this:
# test_some_scenario.py
pytestmark = pytest.mark.scenarios('a.feature')
# override "Scenario 3"
@pytest.mark.scenario('a.feature', 'Scenario 3')
def test_a_scenario(...):
# do something more
pass
instead of the current way:
import pytest_bdd
# override "Scenario 3"
@pytest_bdd.scenario('a.feature', 'Scenario 3')
def test_a_scenario(...):
# do something more
pass
scenarios('a.feature')
I yet don't know if this is entirely feasible without breaking other features, but we will see.
Short note about @scenario(...)
Potentially, I will also remove the single scenario mark/decorator, given that the only thing it allows to do is to require some more fixtures before the scenario is run, and to execute some more logic after the scenario finished.
This custom logic can already be implemented using given and then steps, but I understand that sometimes it can be just some compensation logic that should not appear in the feature file.
I still didn't figure out what to do with this, so probably I'll keep the @scenario mark/decorator for the time being.
@bubenkoff @olegpidsadnyi @sliwinski-milosz: Feedback on this idea would be appreciated.
- Ngôn ngữ chính
- Python
- Star
- 1.5k
- Fork
- 253
- Merge trung bình
- 4 giờ 30 phút
- Pull request đã merge (30 ngày)
- 5
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không 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 pytest-dev/pytest-bdd
-
New release to update `gherkin`?Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
pytest-dev/pytest-bdd#838 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
pytest-dev/pytest-bdd#805 ·
-
YAML support removed in v8Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
pytest-dev/pytest-bdd#785 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
pytest-dev/pytest-bdd#784 ·
-
Tests with failing setup fixture should get the "Error" statusCó thể đã có người làm @zvarych-oleksii đã nhận hôm nay. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
pytest-dev/pytest-bdd#782 ·
Tất cả issue của pytest-dev/pytest-bdd
Issue tương tự
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
fossasia/visdom-dev#77 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
aws-cloudformation/cfn-lint#4890 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
volcengine/OpenViking#6521 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
AstrBotDevs/AstrBot#10720 ·
Maintainer thường phản hồi trong vòng 1 ngày