Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Cucumber-Json flags failed tests as passed if an exception occurs

Đang mở
#430 2 bình luận 1 reaction 0 người được giao Xem trên GitHub

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
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
testing

Hướng nghiên cứu

Tái hiện vấn đề bằng cách chạy feature với một step chưa được định nghĩa và flag --cucumber-json, sau đó kiểm tra cucumber-JSON được tạo ra và cách xử lý scenario.steps. Bản sửa hoàn tất khi một KeyError hoặc FixtureLookupError khiến test case xuất hiện là thất bại thay vì thành công trong báo cáo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Version: bdd-4,0,2 pytest: 6.2.2

Summary
When a test fails with eg an keyerror exception due to an invalid test step, the cucumber-json will mark the test case as passed. When imported back into eg XRAY the test is marked as passed when in fact it has not.

This happens because the invalid step is not included in the test report scenario.steps and will therefore not appear in the cucumber-json causing test cases results to be inaccurate.

Steps to Repro:

  1. Execute a feature file containing a step not defined in the framework. This will trigger an KeyError exception and a FixtureLookupError. Ensure the --cucumber-json flag was passed into pytest-bdd :
Scenario:  repro
    Given this step should exist and be valid
    And this step should not exist

  1. Examine the resultant cucumber-json file. Notice the test case is marked as passed as the erroring test step was not included.
Ngôn ngữ chính
Python
Star
1.5k
Fork
251
Merge trung bình
43 phút
Pull request đã merge (30 ngày)
2

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của pytest-dev/pytest-bdd

Tất cả issue của pytest-dev/pytest-bdd

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.